1 /*** 2 * The contents of this file are subject to the Mozilla Public 3 * License Version 1.1 (the "License"); you may not use this file 4 * except in compliance with the License. You may obtain a copy of 5 * the License at http://www.mozilla.org/MPL/ 6 * 7 * Software distributed under the License is distributed on an "AS 8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 9 * implied. See the License for the specific language governing 10 * rights and limitations under the License. 11 * 12 * The Original Code is pow2toolkit library. 13 * 14 * The Initial Owner of the Original Code is 15 * Power Of Two S.R.L. (www.pow2.com) 16 * 17 * Portions created by Power Of Two S.R.L. are 18 * Copyright (C) Power Of Two S.R.L. 19 * All Rights Reserved. 20 * 21 * Contributor(s): 22 */ 23 24 package com.pow2.user; 25 26 import org.apache.log4j.Category; 27 28 29 /*** 30 * User Address class. 31 * <br> 32 * This class encapsulates the basic user address informations; if you'd like 33 * to have a more specialized Address entity, extend this class and provide 34 * your own implementation. 35 * 36 * @author Luca Fossato 37 */ 38 public class Address 39 { 40 /*** Log4J category. */ 41 protected static Category cat; 42 43 /*** its user */ 44 protected User user; 45 46 /*** user country; i.e.: USA | Italy */ 47 protected String country; 48 49 /*** user state (use only if country == USA) */ 50 protected String state; 51 52 /*** user city */ 53 protected String city; 54 55 /*** user ZIP code */ 56 protected String zipCode; 57 58 /*** user street */ 59 protected String street; 60 61 62 /*** 63 * Constructor. 64 * <br> 65 * Set the user for this address. 66 */ 67 public Address(User newUser) 68 { 69 user = newUser; 70 } 71 72 73 /*** 74 * Sets the user attribute of the Address object 75 * 76 * @param newUser The new user value 77 */ 78 public void setUser(User newUser) 79 { 80 user = newUser; 81 } 82 83 84 /*** 85 * Sets the country attribute of the Address object 86 * 87 * @param newCountry The new country value 88 */ 89 public void setCountry(String newCountry) 90 { 91 country = newCountry; 92 } 93 94 95 /*** 96 * Sets the state attribute of the Address object 97 * 98 * @param newState The new state value 99 */ 100 public void setState(String newState) 101 { 102 state = newState; 103 } 104 105 106 /*** 107 * Sets the city attribute of the Address object 108 * 109 * @param newCity The new city value 110 */ 111 public void setCity(String newCity) 112 { 113 city = newCity; 114 } 115 116 117 /*** 118 * Sets the zipCode attribute of the Address object 119 * 120 * @param newZipCode The new zipCode value 121 */ 122 public void setZipCode(String newZipCode) 123 { 124 zipCode = newZipCode; 125 } 126 127 128 /*** 129 * Sets the street attribute of the Address object 130 * 131 * @param newStreet The new street value 132 */ 133 public void setStreet(String newStreet) 134 { 135 street = newStreet; 136 } 137 138 139 /*** 140 * Gets the user attribute of the Address object 141 * 142 * @return The user value 143 */ 144 public User getUser() 145 { 146 return user; 147 } 148 149 150 /*** 151 * Gets the country attribute of the Address object 152 * 153 * @return The country value 154 */ 155 public String getCountry() 156 { 157 return country; 158 } 159 160 161 /*** 162 * Gets the state attribute of the Address object 163 * 164 * @return The state value 165 */ 166 public String getState() 167 { 168 return state; 169 } 170 171 172 /*** 173 * Gets the city attribute of the Address object 174 * 175 * @return The city value 176 */ 177 public String getCity() 178 { 179 return city; 180 } 181 182 183 /*** 184 * Gets the zipCode attribute of the Address object 185 * 186 * @return The zipCode value 187 */ 188 public String getZipCode() 189 { 190 return zipCode; 191 } 192 193 194 /*** 195 * Gets the street attribute of the Address object 196 * 197 * @return The street value 198 */ 199 public String getStreet() 200 { 201 return street; 202 } 203 }