KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > betwixt > io > read > HouseBean


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.io.read;
17
18 /**
19  * Example enum
20  *
21  * @author Robert Burrell Donkin
22  * @version $Id: HouseBean.java,v 1.4 2004/02/28 13:38:36 yoavs Exp $
23  */

24 public class HouseBean {
25
26     private CompassPoint facing;
27     private AddressBean address;
28     private PersonBean householder;
29     private boolean isTenant;
30     
31     public HouseBean() {}
32     
33     public AddressBean getAddress() {
34         return address;
35     }
36     
37     public void setAddress(AddressBean address) {
38         this.address = address;
39     }
40     
41     public PersonBean getHouseholder() {
42         return householder;
43     }
44         
45     public void setHouseholder(PersonBean householder) {
46         this.householder = householder;
47     }
48     
49     public boolean isTenant() {
50         return isTenant;
51     }
52     
53     public void setTenant(boolean isTenant) {
54         this.isTenant = isTenant;
55     }
56     
57     public CompassPoint getFacing() {
58         return facing;
59     }
60     
61     public void setFacing(CompassPoint facing) {
62         this.facing = facing;
63     }
64
65     public String JavaDoc toString() {
66         return "[" + this.getClass().getName() + ": address=" + address + " householder=" + householder
67         + " facing=" + facing + " tenant=" + isTenant + "]";
68     }
69     
70     public boolean equals( Object JavaDoc obj ) {
71         if ( obj == null ) return false;
72         return this.hashCode() == obj.hashCode();
73     }
74     
75     public int hashCode() {
76         return toString().hashCode();
77     }
78 }
79
Popular Tags