1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  }