01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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,
38: String code) {
39: setStreet(street);
40: setCity(city);
41: setCode(code);
42: setCountry(country);
43: }
44:
45: public String getStreet() {
46: return street;
47: }
48:
49: public String getCity() {
50: return city;
51: }
52:
53: public String getCode() {
54: return code;
55: }
56:
57: public String getCountry() {
58: return country;
59: }
60:
61: public void setStreet(String street) {
62: this .street = street;
63: }
64:
65: public void setCity(String city) {
66: this .city = city;
67: }
68:
69: public void setCode(String code) {
70: this .code = code;
71: }
72:
73: public void setCountry(String country) {
74: this .country = country;
75: }
76:
77: public String toString() {
78: return "[" + this .getClass().getName() + ": street=" + street
79: + ", city=" + city + ", country=" + country + "]";
80: }
81:
82: public boolean equals(Object obj) {
83: if (obj == null)
84: return false;
85: return this .hashCode() == obj.hashCode();
86: }
87:
88: public int hashCode() {
89: return toString().hashCode();
90: }
91: }
|