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