1 package org.appfuse.model; 2 3 import java.io.Serializable ; 4 5 import org.apache.commons.lang.builder.ToStringBuilder; 6 import org.apache.commons.lang.builder.ToStringStyle; 7 8 17 public class Address extends BaseObject implements Serializable { 18 private static final long serialVersionUID = 3617859655330969141L; 19 protected String address; 20 protected String city; 21 protected String province; 22 protected String country; 23 protected String postalCode; 24 25 28 public String getAddress() { 29 return address; 30 } 31 32 36 public String getCity() { 37 return city; 38 } 39 40 44 public String getProvince() { 45 return province; 46 } 47 48 52 public String getCountry() { 53 return country; 54 } 55 56 62 public String getPostalCode() { 63 return postalCode; 64 } 65 66 public void setAddress(String address) { 67 this.address = address; 68 } 69 70 public void setCity(String city) { 71 this.city = city; 72 } 73 74 public void setCountry(String country) { 75 this.country = country; 76 } 77 78 public void setPostalCode(String postalCode) { 79 this.postalCode = postalCode; 80 } 81 82 public void setProvince(String province) { 83 this.province = province; 84 } 85 86 public boolean equals(Object o) { 87 if (this == o) return true; 88 if (!(o instanceof Address)) return false; 89 90 final Address address1 = (Address) o; 91 92 if (address != null ? !address.equals(address1.address) : address1.address != null) return false; 93 if (city != null ? !city.equals(address1.city) : address1.city != null) return false; 94 if (country != null ? !country.equals(address1.country) : address1.country != null) return false; 95 if (postalCode != null ? !postalCode.equals(address1.postalCode) : address1.postalCode != null) return false; 96 if (province != null ? !province.equals(address1.province) : address1.province != null) return false; 97 98 return true; 99 } 100 101 public int hashCode() { 102 int result; 103 result = (address != null ? address.hashCode() : 0); 104 result = 29 * result + (city != null ? city.hashCode() : 0); 105 result = 29 * result + (province != null ? province.hashCode() : 0); 106 result = 29 * result + (country != null ? country.hashCode() : 0); 107 result = 29 * result + (postalCode != null ? postalCode.hashCode() : 0); 108 return result; 109 } 110 111 public String toString() { 112 return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) 113 .append("country", this.country) 114 .append("address", this.address).append("province", 115 this.province).append("postalCode", this.postalCode) 116 .append("city", this.city).toString(); 117 } 118 } 119 | Popular Tags |