KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > xml > person > Address


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.xml.person;
8
9 /**
10  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
11  * @version <tt>$Revision: 1.1 $</tt>
12  */

13 public class Address
14 {
15    private String JavaDoc street;
16
17    public String JavaDoc getStreet()
18    {
19       return street;
20    }
21
22    public void setStreet(String JavaDoc street)
23    {
24       this.street = street;
25    }
26
27    public String JavaDoc toString()
28    {
29       return street;
30    }
31
32    public boolean equals(Object JavaDoc o)
33    {
34       if(this == o) return true;
35       if(!(o instanceof Address)) return false;
36
37       final Address address = (Address) o;
38
39       if(street != null ? !street.equals(address.street) : address.street != null) return false;
40
41       return true;
42    }
43
44    public int hashCode()
45    {
46       return (street != null ? street.hashCode() : 0);
47    }
48 }
49
Popular Tags