2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.usecases.rolodex;
19  
20  /***
21   * <p>Holds an addres for a {@link Contact}.</p>
22   */
23  public class Address {
24      String street1 = null;
25  
26      String street2 = null;
27  
28      String city = null;
29  
30      String state = null;
31  
32      int zip = 0;
33  
34      String province = null;
35  
36      String country = null;
37      
38  
39      /***
40       * <p>
41       * Returns the City.
42       * </p>
43       */
44      public String getCity() {
45          return city;
46      }
47  
48      /***
49       * <p>
50       * Sets the City.
51       * </p>
52       */
53      public void setCity(String city) {
54          this.city = city;
55      }
56  
57      /***
58       * <p>
59       * Gets the Country.
60       * </p>
61       */
62      public String getCountry() {
63          return country;
64      }
65  
66      /***
67       * <p>
68       * Sets the Country.
69       * </p>
70       */
71      public void setCountry(String country) {
72          this.country = country;
73      }
74  
75      /***
76       * <p>
77       * Gets the Province.
78       * </p>
79       */
80      public String getProvince() {
81          return province;
82      }
83  
84      /***
85       * <p>
86       * Sets the Province.
87       * </p>
88       */
89      public void setProvince(String province) {
90          this.province = province;
91      }
92  
93      /***
94       * <p>
95       * Gets the State.
96       * </p>
97       */
98      public String getState() {
99          return state;
100     }
101 
102     /***
103      * <p>
104      * Sets the State.
105      * </p>
106      */
107     public void setState(String state) {
108         this.state = state;
109     }
110 
111     /***
112      * <p>
113      * Gets the Street1.
114      * </p>
115      */
116     public String getStreet1() {
117         return street1;
118     }
119 
120     /***
121      * <p>
122      * Sets the Street1.
123      * </p>
124      */
125     public void setStreet1(String street1) {
126         this.street1 = street1;
127     }
128 
129     /***
130      * <p>
131      * Gets the Street2.
132      * </p>
133      */
134     public String getStreet2() {
135         return street2;
136     }
137 
138     /***
139      * <p>
140      * Sets the Street2.
141      * </p>
142      */
143     public void setStreet2(String street2) {
144         this.street2 = street2;
145     }
146 
147     /***
148      * <p>
149      * Gets the Zip Code.
150      * </p>
151      */
152     public int getZip() {
153         return zip;
154     }
155 
156     /***
157      * <p>
158      * Sets the Zip Code.
159      * </p>
160      */
161     public void setZip(int zip) {
162         this.zip = zip;
163     }
164 
165     
166     /***
167      * <p>
168      * Gets the Zip Code.
169      * </p>
170      */
171     public String getZipAsString() {
172         return String.valueOf(zip);
173     }
174 
175     /***
176      * <p>
177      * Sets the Zip Code.
178      * </p>
179      */
180     public void setZipAsString(String zip) {
181         try {
182             this.zip = Integer.parseInt(zip);
183         } catch (NumberFormatException e) {}
184     }
185 
186 }