1 7 package org.jboss.test.xml.person; 8 9 13 public class Address 14 { 15 private String street; 16 17 public String getStreet() 18 { 19 return street; 20 } 21 22 public void setStreet(String street) 23 { 24 this.street = street; 25 } 26 27 public String toString() 28 { 29 return street; 30 } 31 32 public boolean equals(Object 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 |