1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.betwixt;
17
18 import java.io.Serializable;
19
20 /*** <p><code>CustomerBean</code> is a sample bean for use by the test cases.</p>
21 *
22 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
23 * @author <a href="mailto:michael.davey@coderage.org">Michael Davey</a>
24 * @version $Revision: 155402 $
25 */
26 public class AddressBean implements Serializable {
27
28 private String street;
29 private String city;
30 private String code;
31 private String country;
32
33 public AddressBean() {
34 }
35
36 public AddressBean(String street, String city, String country, String code) {
37 setStreet(street);
38 setCity(city);
39 setCode(code);
40 setCountry(country);
41 }
42
43 public String getStreet() {
44 return street;
45 }
46
47 public String getCity() {
48 return city;
49 }
50
51 public String getCode() {
52 return code;
53 }
54
55 public String getCountry() {
56 return country;
57 }
58
59 public void setStreet(String street) {
60 this.street = street;
61 }
62
63 public void setCity(String city) {
64 this.city = city;
65 }
66
67 public void setCode(String code) {
68 this.code = code;
69 }
70
71 public void setCountry(String country) {
72 this.country = country;
73 }
74
75 public String toString() {
76 return "[" + this.getClass().getName() + ": street=" + street + ", city="
77 + city+ ", country=" + country + "]";
78 }
79
80 public boolean equals( Object obj ) {
81 if ( obj == null ) return false;
82 return this.hashCode() == obj.hashCode();
83 }
84
85 public int hashCode() {
86 return toString().hashCode();
87 }
88 }