1 4 package test.interfaces; 5 6 19 public class CustomerLightValue 20 extends java.lang.Object 21 implements java.io.Serializable , java.lang.Cloneable 22 { 23 24 private float credit; 25 private boolean creditHasBeenSet = false; 26 27 private java.lang.String [][] array; 28 private boolean arrayHasBeenSet = false; 29 30 private byte[] image; 31 private boolean imageHasBeenSet = false; 32 33 private java.lang.String id; 34 private boolean idHasBeenSet = false; 35 36 private test.interfaces.CustomerPK primaryKey; 37 38 private int _version = 0; 39 40 public CustomerLightValue() 41 { 42 primaryKey = new test.interfaces.CustomerPK(); 43 } 44 45 public CustomerLightValue( float credit,java.lang.String [][] array,byte[] image,java.lang.String id ) 46 { 47 setCredit(credit); 48 setArray(array); 49 setImage(image); 50 setId(id); 51 primaryKey = new test.interfaces.CustomerPK(this.getId()); 52 } 53 54 57 public CustomerLightValue( CustomerLightValue otherValue ) 58 { 59 this.credit = otherValue.credit; 60 creditHasBeenSet = true; 61 this.array = otherValue.array; 62 arrayHasBeenSet = true; 63 this.image = otherValue.image; 64 imageHasBeenSet = true; 65 this.id = otherValue.id; 66 idHasBeenSet = true; 67 68 primaryKey = new test.interfaces.CustomerPK(this.getId()); 69 } 70 71 public test.interfaces.CustomerPK getPrimaryKey() 72 { 73 return primaryKey; 74 } 75 76 public void setPrimaryKey( test.interfaces.CustomerPK primaryKey) 77 { 78 this.primaryKey = primaryKey; 81 setId( primaryKey.id ); 82 } 83 84 public float getCredit() 85 { 86 return this.credit; 87 } 88 89 public void setCredit( float credit ) 90 { 91 this.credit = credit; 92 creditHasBeenSet = true; 93 94 } 95 96 public boolean creditHasBeenSet(){ 97 return creditHasBeenSet; 98 } 99 public java.lang.String [][] getArray() 100 { 101 return this.array; 102 } 103 104 private void setArray( java.lang.String [][] array ) 105 { 106 this.array = array; 107 arrayHasBeenSet = true; 108 109 } 110 111 public byte[] getImage() 112 { 113 return this.image; 114 } 115 116 private void setImage( byte[] image ) 117 { 118 this.image = image; 119 imageHasBeenSet = true; 120 121 } 122 123 public java.lang.String getId() 124 { 125 return this.id; 126 } 127 128 public void setId( java.lang.String id ) 129 { 130 this.id = id; 131 idHasBeenSet = true; 132 133 primaryKey.setId(id); 134 } 135 136 public boolean idHasBeenSet(){ 137 return idHasBeenSet; 138 } 139 140 public int getVersion() 141 { 142 return _version; 143 } 144 public void setVersion(int version) 145 { 146 this._version = version; 147 } 148 149 public String toString() 150 { 151 StringBuffer str = new StringBuffer ("{"); 152 153 str.append("credit=" + getCredit() + " " + "array=" + getArray() + " " + "image=" + getImage() + " " + "id=" + getId()); 154 str.append(",version="); 155 str.append(_version); 156 str.append('}'); 157 158 return(str.toString()); 159 } 160 161 166 protected boolean hasIdentity() 167 { 168 boolean ret = true; 169 ret = ret && idHasBeenSet; 170 return ret; 171 } 172 173 177 public boolean isIdentical(Object other) 178 { 179 if (other instanceof CustomerLightValue) 180 { 181 CustomerLightValue that = (CustomerLightValue) other; 182 boolean lEquals = true; 183 lEquals = lEquals && this.credit == that.credit; 184 if( this.array == null ) 185 { 186 lEquals = lEquals && ( that.array == null ); 187 } 188 else 189 { 190 lEquals = lEquals && this.array.equals( that.array ); 191 } 192 lEquals = lEquals && this.image == that.image; 193 194 return lEquals; 195 } 196 else 197 { 198 return false; 199 } 200 } 201 202 public boolean equals(Object other) { 203 204 if (!(other instanceof CustomerLightValue)) { 206 return false; 207 } 208 209 return equals((CustomerLightValue) other); 210 } 211 212 217 public boolean equals(CustomerLightValue that) { 218 219 if (this == that) { 221 return true; 222 } 223 if(null == that) { 225 return false; 226 } 227 228 if(this.credit != that.credit) { 229 return false; 230 } 231 232 if(this.array != that.array) { 233 234 if( this.array == null || that.array == null ) { 235 return false; 236 } 237 238 if(!this.array.equals(that.array)) { 239 return false; 240 } 241 242 } 243 244 if(!java.util.Arrays.equals(this.image, that.image)) { 245 return false; 246 } 247 248 if(this.id != that.id) { 249 250 if( this.id == null || that.id == null ) { 251 return false; 252 } 253 254 if(!this.id.equals(that.id)) { 255 return false; 256 } 257 258 } 259 260 return true; 261 262 } 263 264 public Object clone() throws java.lang.CloneNotSupportedException { 265 CustomerLightValue other = (CustomerLightValue) super.clone(); 266 267 return other; 268 } 269 270 public ReadOnlyCustomerLightValue getReadOnlyCustomerLightValue() { 271 return new ReadOnlyCustomerLightValue(); 272 } 273 274 public int hashCode(){ 275 int result = 17; 276 result = 37*result + Float.floatToIntBits(credit); 277 278 result = 37*result + ((this.array != null) ? this.array.hashCode() : 0); 279 280 if (image != null) { 281 for (int i=0; i<image.length; i++) 282 { 283 long l = image[i]; 284 result = 37*result + (int)(l^(l>>>32)); 285 } 286 } 287 288 result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); 289 290 return result; 291 } 292 293 300 private static java.util.Collection wrapCollection(java.util.Collection input) { 301 return java.util.Collections.synchronizedCollection(input); 302 } 303 310 private static java.util.Set wrapCollection(java.util.Set input) { 311 return java.util.Collections.synchronizedSet(input); 312 } 313 319 private static java.util.Collection wrapReadOnly(java.util.Collection input) { 320 return java.util.Collections.unmodifiableCollection(input); 321 } 322 328 private static java.util.Set wrapReadOnly(java.util.Set input) { 329 return java.util.Collections.unmodifiableSet(input); 330 } 331 332 private final class ReadOnlyCustomerLightValue 333 implements java.lang.Cloneable , java.io.Serializable 334 { 335 private CustomerLightValue underlying() { 336 return CustomerLightValue.this; 337 } 338 339 public float getCredit() { 340 return underlying().credit; 341 } 342 343 public java.lang.String [][] getArray() { 344 return underlying().array; 345 } 346 347 public byte[] getImage() { 348 return underlying().image; 349 } 350 351 public java.lang.String getId() { 352 return underlying().id; 353 } 354 355 public int hashCode() { 356 return 101 * underlying().hashCode(); 357 } 358 359 public boolean equals(Object o) { 360 if(o instanceof ReadOnlyCustomerLightValue) { 361 return this.equals((ReadOnlyCustomerLightValue) o); 362 } 363 return false; 364 } 365 366 public boolean equals(ReadOnlyCustomerLightValue that) { 367 if(null == that) { 368 return false; 369 } 370 371 return this.underlying().equals(that.underlying()); 372 } 373 374 } 375 376 } 377 | Popular Tags |