1 package org.hibernate.test.legacy; 3 4 import java.io.Serializable ; 5 import java.util.Locale ; 6 7 public class Location implements Serializable { 8 private int streetNumber; 9 private String city; 10 private String streetName; 11 private String countryCode; 12 private Locale locale; 13 private String description; 14 15 19 public String getCountryCode() { 20 return countryCode; 21 } 22 23 27 public String getDescription() { 28 return description; 29 } 30 31 35 public Locale getLocale() { 36 return locale; 37 } 38 39 43 public String getStreetName() { 44 return streetName; 45 } 46 47 51 public int getStreetNumber() { 52 return streetNumber; 53 } 54 55 59 public void setCountryCode(String countryCode) { 60 this.countryCode = countryCode; 61 } 62 63 67 public void setDescription(String description) { 68 this.description = description; 69 } 70 71 75 public void setLocale(Locale locale) { 76 this.locale = locale; 77 } 78 79 83 public void setStreetName(String streetName) { 84 this.streetName = streetName; 85 } 86 87 91 public void setStreetNumber(int streetNumber) { 92 this.streetNumber = streetNumber; 93 } 94 95 99 public String getCity() { 100 return city; 101 } 102 103 107 public void setCity(String city) { 108 this.city = city; 109 } 110 111 public boolean equals(Object other) { 112 Location l = (Location) other; 113 return l.getCity().equals(city) && l.getStreetName().equals(streetName) && l.getCountryCode().equals(countryCode) && l.getStreetNumber()==streetNumber; 114 } 115 public int hashCode() { 116 return streetName.hashCode(); 117 } 118 119 } 120 121 122 123 124 125 126 | Popular Tags |