KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > betwixt > AddressBean


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 JavaDoc;
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: 1.4 $
25   */

26 public class AddressBean implements Serializable JavaDoc {
27
28     private String JavaDoc street;
29     private String JavaDoc city;
30     private String JavaDoc code;
31     private String JavaDoc country;
32     
33     public AddressBean() {
34     }
35     
36     public AddressBean(String JavaDoc street, String JavaDoc city, String JavaDoc country, String JavaDoc code) {
37         setStreet(street);
38         setCity(city);
39         setCode(code);
40         setCountry(country);
41     }
42
43     public String JavaDoc getStreet() {
44         return street;
45     }
46     
47     public String JavaDoc getCity() {
48         return city;
49     }
50
51     public String JavaDoc getCode() {
52         return code;
53     }
54
55     public String JavaDoc getCountry() {
56         return country;
57     }
58
59     public void setStreet(String JavaDoc street) {
60         this.street = street;
61     }
62     
63     public void setCity(String JavaDoc city) {
64         this.city = city;
65     }
66     
67     public void setCode(String JavaDoc code) {
68         this.code = code;
69     }
70     
71     public void setCountry(String JavaDoc country) {
72         this.country = country;
73     }
74     
75     public String JavaDoc toString() {
76         return "[" + this.getClass().getName() + ": street=" + street + ", city="
77                 + city+ ", country=" + country + "]";
78     }
79     
80     public boolean equals( Object JavaDoc 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 }
89
Popular Tags