KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > domain > Address


1 /*
2  * Created on Feb 22, 2003
3  */

4 package xpetstore.domain;
5
6 import java.io.Serializable JavaDoc;
7
8
9 /**
10  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
11  */

12 public class Address
13     implements Serializable JavaDoc
14 {
15     //~ Instance fields --------------------------------------------------------
16

17     private String JavaDoc _city = "";
18     private String JavaDoc _country = "";
19     private String JavaDoc _state = "";
20     private String JavaDoc _street1 = "";
21     private String JavaDoc _street2 = "";
22     private String JavaDoc _zipcode = "";
23
24     //~ Constructors -----------------------------------------------------------
25

26     public Address( )
27     {
28         super( );
29     }
30
31     public Address( Address addr )
32     {
33         set( addr );
34     }
35
36     //~ Methods ----------------------------------------------------------------
37

38     /**
39      * @return String
40      *
41      * @hibernate.property
42      * length="25"
43      */

44     public String JavaDoc getCity( )
45     {
46         return _city;
47     }
48
49     /**
50      * @return String
51      *
52      * @hibernate.property
53      * length="3"
54      */

55     public String JavaDoc getCountry( )
56     {
57         return _country;
58     }
59
60     /**
61      * @return String
62      *
63      * @hibernate.property
64      * length="3"
65      */

66     public String JavaDoc getState( )
67     {
68         return _state;
69     }
70
71     /**
72      * @return String
73      *
74      * @hibernate.property
75      * length="50"
76      */

77     public String JavaDoc getStreet1( )
78     {
79         return _street1;
80     }
81
82     /**
83      * @return String
84      *
85      * @hibernate.property
86      * length="50"
87      */

88     public String JavaDoc getStreet2( )
89     {
90         return _street2;
91     }
92
93     /**
94      * @return String
95      *
96      * @hibernate.property
97      * length="10"
98      */

99     public String JavaDoc getZipcode( )
100     {
101         return _zipcode;
102     }
103
104     public void set( Address address )
105     {
106         _street1 = address.getStreet1( );
107         _street2 = address.getStreet2( );
108         _city = address.getCity( );
109         _state = address.getState( );
110         _country = address.getCountry( );
111         _zipcode = address.getZipcode( );
112     }
113
114     /**
115      * Sets the city.
116      * @param city The city to set
117      */

118     public void setCity( String JavaDoc city )
119     {
120         _city = city;
121     }
122
123     /**
124      * Sets the country.
125      * @param country The country to set
126      */

127     public void setCountry( String JavaDoc country )
128     {
129         _country = country;
130     }
131
132     /**
133      * Sets the state.
134      * @param state The state to set
135      */

136     public void setState( String JavaDoc state )
137     {
138         _state = state;
139     }
140
141     /**
142      * Sets the street1.
143      * @param street1 The street1 to set
144      */

145     public void setStreet1( String JavaDoc street1 )
146     {
147         _street1 = street1;
148     }
149
150     /**
151      * Sets the street2.
152      * @param street2 The street2 to set
153      */

154     public void setStreet2( String JavaDoc street2 )
155     {
156         _street2 = street2;
157     }
158
159     /**
160      * Sets the zipcode.
161      * @param zipcode The zipcode to set
162      */

163     public void setZipcode( String JavaDoc zipcode )
164     {
165         _zipcode = zipcode;
166     }
167 }
168
Popular Tags