001 package org.rakeshv.xml.addressbook;
002
003 /**
004 * A <code>bean</code> that represents a postal address. Multiple
005 * postal addresses may be available for a person in the address book.
006 *
007 * <p>Copyright 2003 Rakesh Vidyadharan</p>
008 *
009 * @author Rakesh Vidyadharan 2003 February 12
010 * @version $Id: Address.java,v 1.3 2004/05/26 11:42:39 rakesh Exp $
011 */
012 public class Address extends Object
013 {
014 /**
015 * The street address of the person. This field maps to the
016 * <code>street1</code> element.
017 */
018 private String street1 = null;
019
020 /**
021 * The secondary street address of the person. This field maps to the
022 * <code>street2</code> element.
023 */
024 private String street2 = null;
025
026 /**
027 * The tertiary street address of the person. This field maps to the
028 * <code>street3</code> element.
029 */
030 private String street3 = null;
031
032 /**
033 * The city to which the address belongs. This field maps to the
034 * <code>city</code> element.
035 */
036 private String city = null;
037
038 /**
039 * The state to which the address belongs. This field maps to the
040 * <code>state</code> element.
041 */
042 private String state = null;
043
044 /**
045 * The postal code of the address. This field maps to the
046 * <code>postalCode</code> element.
047 */
048 private String postalCode = null;
049
050 /**
051 * The country to which the address belongs. This field maps to the
052 * <code>country</code> element.
053 */
054 private String country = null;
055
056 /**
057 * Default constructor. Just serves to create an instance, which
058 * may then be used to populate the fields using the mutator methods.
059 */
060 public Address()
061 {
062 super();
063 }
064
065 /**
066 * Construct an new address with most of the common fields populated.
067 * Simply invokes {@link #Address( String, String, String, String,
068 * String, String, String )} with <code>null</code> values for
069 * {@link #street2} and {@link #street3}.
070 *
071 * @param street1 - The first line of the street address.
072 * @param city - The city of the address.
073 * @param state - The state of the address.
074 * @param postalCode - The postalCode of the address.
075 * @param country - The country of the address.
076 */
077 public Address( String street1, String city, String state,
078 String postalCode, String country )
079 {
080 this( street1, null, null, city, state, postalCode, country );
081 }
082
083 /**
084 * Construct an new address with all the fields populated.
085 *
086 * @param street1 - The first line of the street address.
087 * @param street2 - The second line of the street address.
088 * @param street3 - The third line of the street address.
089 * @param city - The city of the address.
090 * @param state - The state of the address.
091 * @param postalCode - The postalCode of the address.
092 * @param country - The country of the address.
093 */
094 public Address( String street1, String street2, String street3,
095 String city, String state, String postalCode, String country )
096 {
097 this.street1 = street1;
098 this.street2 = street2;
099 this.street3 = street3;
100 this.city = city;
101 this.state = state;
102 this.postalCode = postalCode;
103 this.country = country;
104 }
105
106 /**
107 * Return the value/reference of the {@link #street1}.
108 *
109 * @return String - The value/reference of street1.
110 */
111 public final String getStreet1()
112 {
113 return street1;
114 }
115
116 /**
117 * Set the value of {@link #street1}.
118 *
119 * @param street1 - The value to set.
120 */
121 public final void setStreet1(String street1)
122 {
123 this.street1 = street1;
124 }
125
126 /**
127 * Return the value/reference of the {@link #street2}.
128 *
129 * @return String - The value/reference of street2.
130 */
131 public final String getStreet2()
132 {
133 return street2;
134 }
135
136 /**
137 * Set the value of {@link #street2}.
138 *
139 * @param street2 - The value to set.
140 */
141 public final void setStreet2(String street2)
142 {
143 this.street2 = street2;
144 }
145
146 /**
147 * Return the value/reference of the {@link #street3}.
148 *
149 * @return String - The value/reference of street3.
150 */
151 public final String getStreet3()
152 {
153 return street3;
154 }
155
156 /**
157 * Set the value of {@link #street3}.
158 *
159 * @param street3 - The value to set.
160 */
161 public final void setStreet3(String street3)
162 {
163 this.street3 = street3;
164 }
165
166 /**
167 * Return the value/reference of the {@link #city}.
168 *
169 * @return String - The value/reference of city.
170 */
171 public final String getCity()
172 {
173 return city;
174 }
175
176 /**
177 * Set the value of {@link #city}.
178 *
179 * @param city - The value to set.
180 */
181 public final void setCity(String city)
182 {
183 this.city = city;
184 }
185
186 /**
187 * Return the value/reference of the {@link #state}.
188 *
189 * @return String - The value/reference of state.
190 */
191 public final String getState()
192 {
193 return state;
194 }
195
196 /**
197 * Set the value of {@link #state}.
198 *
199 * @param state - The value to set.
200 */
201 public final void setState(String state)
202 {
203 this.state = state;
204 }
205
206 /**
207 * Return the value/reference of the {@link #postalCode}.
208 *
209 * @return String - The value/reference of postalCode.
210 */
211 public final String getPostalCode()
212 {
213 return postalCode;
214 }
215
216 /**
217 * Set the value of {@link #postalCode}.
218 *
219 * @param postalCode - The value to set.
220 */
221 public final void setPostalCode(String postalCode)
222 {
223 this.postalCode = postalCode;
224 }
225
226 /**
227 * Return the value/reference of the {@link #country}.
228 *
229 * @return String - The value/reference of country.
230 */
231 public final String getCountry()
232 {
233 return country;
234 }
235
236 /**
237 * Set the value of {@link #country}.
238 *
239 * @param country - The value to set.
240 */
241 public final void setCountry(String country)
242 {
243 this.country = country;
244 }
245 }