1 package com.panogenesis.model;
2
3 import java.io.Serializable;
4
5 import org.apache.commons.lang.builder.EqualsBuilder;
6 import org.apache.commons.lang.builder.HashCodeBuilder;
7 import org.apache.commons.lang.builder.ToStringBuilder;
8 import org.apache.commons.lang.builder.ToStringStyle;
9 /***
10 * This class is used to represent an address.</p>
11 *
12 * <p><a href="Address.java.html"><i>View Source</i></a></p>
13 *
14 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
15 *
16 */
17 public class Address extends BaseObject implements Serializable {
18 protected String address;
19 protected String city;
20 protected String province;
21 protected String country;
22 protected String postalCode;
23
24 /***
25 * Returns the address.
26 * @return String
27 *
28 * @hibernate.property column="address" not-null="false" length="150"
29 */
30 public String getAddress() {
31 return address;
32 }
33
34 /***
35 * Returns the city.
36 * @return String
37 *
38 * @hibernate.property column="city" not-null="true" length="50"
39 */
40 public String getCity() {
41 return city;
42 }
43
44 /***
45 * Returns the province.
46 * @return String
47 *
48
49 * @hibernate.property column="province" length="100"
50 */
51 public String getProvince() {
52 return province;
53 }
54
55 /***
56 * Returns the country.
57 * @return String
58 *
59 * @hibernate.property column="country" length="100"
60 */
61 public String getCountry() {
62 return country;
63 }
64
65 /***
66 * Returns the postalCode.
67 * @return String
68 *
69 * @hibernate.property column="postal_code" not-null="true" length="15"
70 */
71 public String getPostalCode() {
72 return postalCode;
73 }
74
75 /***
76 * Sets the address.
77 * @param address The address to set
78 */
79 public void setAddress(String address) {
80 this.address = address;
81 }
82
83 /***
84 * Sets the city.
85 * @param city The city to set
86 *
87 * @spring.validator type="required"
88 */
89 public void setCity(String city) {
90 this.city = city;
91 }
92
93 /***
94 * Sets the country.
95 * @param country The country to set
96 *
97 * @spring.validator type="required"
98 */
99 public void setCountry(String country) {
100 this.country = country;
101 }
102
103 /***
104 * Sets the postalCode.
105 * @param postalCode The postalCode to set
106 *
107 * @spring.validator type="required"
108 * @spring.validator type="mask" msgkey="errors.zip"
109 * @spring.validator-var name="mask" value="${zip}"
110 */
111 public void setPostalCode(String postalCode) {
112 this.postalCode = postalCode;
113 }
114
115 /***
116 * Sets the province.
117 * @param province The province to set
118 *
119 * @spring.validator type="required"
120 */
121 public void setProvince(String province) {
122 this.province = province;
123 }
124
125 /***
126 * Generated using Commonclipse (http://commonclipse.sf.net)
127 */
128 public boolean equals(Object object) {
129 if (!(object instanceof Address)) {
130 return false;
131 }
132
133 Address rhs = (Address) object;
134
135 return new EqualsBuilder().append(this.postalCode, rhs.postalCode)
136 .append(this.country, rhs.country)
137 .append(this.address, rhs.address)
138 .append(this.province, rhs.province)
139 .append(this.city, rhs.city).isEquals();
140 }
141
142 /***
143 * Generated using Commonclipse (http://commonclipse.sf.net)
144 */
145 public int hashCode() {
146 return new HashCodeBuilder(-426830461, 631494429).append(this.postalCode)
147 .append(this.country)
148 .append(this.address)
149 .append(this.province)
150 .append(this.city)
151 .toHashCode();
152 }
153
154 /***
155 * Generated using Commonclipse (http://commonclipse.sf.net)
156 */
157 public String toString() {
158 return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
159 .append("country", this.country)
160 .append("address", this.address).append("province",
161 this.province).append("postalCode", this.postalCode)
162 .append("city", this.city).toString();
163 }
164 }