1 4 package test.interfaces; 5 6 19 public class AddressValue 20 extends java.lang.Object 21 implements java.io.Serializable , java.lang.Cloneable 22 { 23 24 private java.lang.String id; 25 private boolean idHasBeenSet = false; 26 27 private java.lang.String street; 28 private boolean streetHasBeenSet = false; 29 30 private java.lang.String city; 31 private boolean cityHasBeenSet = false; 32 33 private int readOnly; 34 private boolean readOnlyHasBeenSet = false; 35 36 private java.lang.String primaryKey; 37 38 public AddressValue() 39 { 40 } 41 42 public AddressValue( java.lang.String id,java.lang.String street,java.lang.String city,int readOnly ) 43 { 44 setId(id); 45 setStreet(street); 46 setCity(city); 47 setReadOnly(readOnly); 48 primaryKey = this.getId(); 49 } 50 51 54 public AddressValue( AddressValue otherValue ) 55 { 56 this.id = otherValue.id; 57 idHasBeenSet = true; 58 this.street = otherValue.street; 59 streetHasBeenSet = true; 60 this.city = otherValue.city; 61 cityHasBeenSet = true; 62 this.readOnly = otherValue.readOnly; 63 readOnlyHasBeenSet = true; 64 65 primaryKey = this.getId(); 66 } 67 68 public java.lang.String getPrimaryKey() 69 { 70 return primaryKey; 71 } 72 73 public void setPrimaryKey( java.lang.String primaryKey) 74 { 75 this.primaryKey = primaryKey; 78 setId( primaryKey ); 79 } 80 81 public java.lang.String getId() 82 { 83 return this.id; 84 } 85 86 public void setId( java.lang.String id ) 87 { 88 this.id = id; 89 idHasBeenSet = true; 90 91 primaryKey = id; 92 } 93 94 public boolean idHasBeenSet(){ 95 return idHasBeenSet; 96 } 97 public java.lang.String getStreet() 98 { 99 return this.street; 100 } 101 102 private void setStreet( java.lang.String street ) 103 { 104 this.street = street; 105 streetHasBeenSet = true; 106 107 } 108 109 public java.lang.String getCity() 110 { 111 return this.city; 112 } 113 114 private void setCity( java.lang.String city ) 115 { 116 this.city = city; 117 cityHasBeenSet = true; 118 119 } 120 121 public int getReadOnly() 122 { 123 return this.readOnly; 124 } 125 126 private void setReadOnly( int readOnly ) 127 { 128 this.readOnly = readOnly; 129 readOnlyHasBeenSet = true; 130 131 } 132 133 public String toString() 134 { 135 StringBuffer str = new StringBuffer ("{"); 136 137 str.append("id=" + getId() + " " + "street=" + getStreet() + " " + "city=" + getCity() + " " + "readOnly=" + getReadOnly()); 138 str.append('}'); 139 140 return(str.toString()); 141 } 142 143 148 protected boolean hasIdentity() 149 { 150 return idHasBeenSet; 151 } 152 153 157 public boolean isIdentical(Object other) 158 { 159 if (other instanceof AddressValue) 160 { 161 AddressValue that = (AddressValue) other; 162 boolean lEquals = true; 163 if( this.street == null ) 164 { 165 lEquals = lEquals && ( that.street == null ); 166 } 167 else 168 { 169 lEquals = lEquals && this.street.equals( that.street ); 170 } 171 if( this.city == null ) 172 { 173 lEquals = lEquals && ( that.city == null ); 174 } 175 else 176 { 177 lEquals = lEquals && this.city.equals( that.city ); 178 } 179 lEquals = lEquals && this.readOnly == that.readOnly; 180 181 return lEquals; 182 } 183 else 184 { 185 return false; 186 } 187 } 188 189 public boolean equals(Object other) { 190 191 if (!(other instanceof AddressValue)) { 193 return false; 194 } 195 196 return equals((AddressValue) other); 197 } 198 199 204 public boolean equals(AddressValue that) { 205 206 if (this == that) { 208 return true; 209 } 210 if(null == that) { 212 return false; 213 } 214 215 if(this.id != that.id) { 216 217 if( this.id == null || that.id == null ) { 218 return false; 219 } 220 221 if(!this.id.equals(that.id)) { 222 return false; 223 } 224 225 } 226 227 if(this.street != that.street) { 228 229 if( this.street == null || that.street == null ) { 230 return false; 231 } 232 233 if(!this.street.equals(that.street)) { 234 return false; 235 } 236 237 } 238 239 if(this.city != that.city) { 240 241 if( this.city == null || that.city == null ) { 242 return false; 243 } 244 245 if(!this.city.equals(that.city)) { 246 return false; 247 } 248 249 } 250 251 if(this.readOnly != that.readOnly) { 252 return false; 253 } 254 255 return true; 256 257 } 258 259 public Object clone() throws java.lang.CloneNotSupportedException { 260 AddressValue other = (AddressValue) super.clone(); 261 262 return other; 263 } 264 265 public ReadOnlyAddressValue getReadOnlyAddressValue() { 266 return new ReadOnlyAddressValue(); 267 } 268 269 public int hashCode(){ 270 int result = 17; 271 result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); 272 273 result = 37*result + ((this.street != null) ? this.street.hashCode() : 0); 274 275 result = 37*result + ((this.city != null) ? this.city.hashCode() : 0); 276 277 result = 37*result + (int) readOnly; 278 279 return result; 280 } 281 282 289 private static java.util.Collection wrapCollection(java.util.Collection input) { 290 return java.util.Collections.synchronizedCollection(input); 291 } 292 299 private static java.util.Set wrapCollection(java.util.Set input) { 300 return java.util.Collections.synchronizedSet(input); 301 } 302 308 private static java.util.Collection wrapReadOnly(java.util.Collection input) { 309 return java.util.Collections.unmodifiableCollection(input); 310 } 311 317 private static java.util.Set wrapReadOnly(java.util.Set input) { 318 return java.util.Collections.unmodifiableSet(input); 319 } 320 321 private final class ReadOnlyAddressValue 322 implements java.lang.Cloneable , java.io.Serializable 323 { 324 private AddressValue underlying() { 325 return AddressValue.this; 326 } 327 328 public java.lang.String getId() { 329 return underlying().id; 330 } 331 332 public java.lang.String getStreet() { 333 return underlying().street; 334 } 335 336 public java.lang.String getCity() { 337 return underlying().city; 338 } 339 340 public int getReadOnly() { 341 return underlying().readOnly; 342 } 343 344 public int hashCode() { 345 return 101 * underlying().hashCode(); 346 } 347 348 public boolean equals(Object o) { 349 if(o instanceof ReadOnlyAddressValue) { 350 return this.equals((ReadOnlyAddressValue) o); 351 } 352 return false; 353 } 354 355 public boolean equals(ReadOnlyAddressValue that) { 356 if(null == that) { 357 return false; 358 } 359 360 return this.underlying().equals(that.underlying()); 361 } 362 363 } 364 365 } 366 | Popular Tags |