1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.commons.betwixt;
18
19 import java.io.Serializable;
20
21 /** <p><code>CustomerBean</code> is a sample bean for use by the test cases.</p>
22 *
23 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
24 * @author <a href="mailto:michael.davey@coderage.org">Michael Davey</a>
25 * @version $Revision: 438373 $
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 }