KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > Location


1 //$Id: Location.java,v 1.1 2004/09/26 05:18:25 oneovthafew Exp $
2
package org.hibernate.test.legacy;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Locale JavaDoc;
6
7 public class Location implements Serializable JavaDoc {
8     private int streetNumber;
9     private String JavaDoc city;
10     private String JavaDoc streetName;
11     private String JavaDoc countryCode;
12     private Locale JavaDoc locale;
13     private String JavaDoc description;
14     
15     /**
16      * Returns the countryCode.
17      * @return String
18      */

19     public String JavaDoc getCountryCode() {
20         return countryCode;
21     }
22     
23     /**
24      * Returns the description.
25      * @return String
26      */

27     public String JavaDoc getDescription() {
28         return description;
29     }
30     
31     /**
32      * Returns the locale.
33      * @return Locale
34      */

35     public Locale JavaDoc getLocale() {
36         return locale;
37     }
38     
39     /**
40      * Returns the streetName.
41      * @return String
42      */

43     public String JavaDoc getStreetName() {
44         return streetName;
45     }
46     
47     /**
48      * Returns the streetNumber.
49      * @return int
50      */

51     public int getStreetNumber() {
52         return streetNumber;
53     }
54     
55     /**
56      * Sets the countryCode.
57      * @param countryCode The countryCode to set
58      */

59     public void setCountryCode(String JavaDoc countryCode) {
60         this.countryCode = countryCode;
61     }
62     
63     /**
64      * Sets the description.
65      * @param description The description to set
66      */

67     public void setDescription(String JavaDoc description) {
68         this.description = description;
69     }
70     
71     /**
72      * Sets the locale.
73      * @param locale The locale to set
74      */

75     public void setLocale(Locale JavaDoc locale) {
76         this.locale = locale;
77     }
78     
79     /**
80      * Sets the streetName.
81      * @param streetName The streetName to set
82      */

83     public void setStreetName(String JavaDoc streetName) {
84         this.streetName = streetName;
85     }
86     
87     /**
88      * Sets the streetNumber.
89      * @param streetNumber The streetNumber to set
90      */

91     public void setStreetNumber(int streetNumber) {
92         this.streetNumber = streetNumber;
93     }
94     
95     /**
96      * Returns the city.
97      * @return String
98      */

99     public String JavaDoc getCity() {
100         return city;
101     }
102     
103     /**
104      * Sets the city.
105      * @param city The city to set
106      */

107     public void setCity(String JavaDoc city) {
108         this.city = city;
109     }
110     
111     public boolean equals(Object JavaDoc other) {
112         Location l = (Location) other;
113         return l.getCity().equals(city) && l.getStreetName().equals(streetName) && l.getCountryCode().equals(countryCode) && l.getStreetNumber()==streetNumber;
114     }
115     public int hashCode() {
116         return streetName.hashCode();
117     }
118     
119 }
120
121
122
123
124
125
126
Popular Tags