1 4 package test.interfaces; 5 6 19 public class CustomerNormalValue 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 float tax; 34 private boolean taxHasBeenSet = false; 35 36 private java.lang.String id; 37 private boolean idHasBeenSet = false; 38 39 private java.lang.String name; 40 private boolean nameHasBeenSet = false; 41 42 private java.lang.String firstName; 43 private boolean firstNameHasBeenSet = false; 44 private java.util.Collection AccountViews = wrapCollection(new java.util.ArrayList () ); 45 46 private java.util.Collection ShippingAddressValues = wrapCollection(new java.util.ArrayList () ); 47 48 private test.interfaces.CustomerPK primaryKey; 49 50 private int _version = 0; 51 52 public CustomerNormalValue() 53 { 54 primaryKey = new test.interfaces.CustomerPK(); 55 } 56 57 public CustomerNormalValue( float credit,java.lang.String [][] array,byte[] image,float tax,java.lang.String id,java.lang.String name,java.lang.String firstName ) 58 { 59 setCredit(credit); 60 setArray(array); 61 setImage(image); 62 setTax(tax); 63 setId(id); 64 setName(name); 65 setFirstName(firstName); 66 primaryKey = new test.interfaces.CustomerPK(this.getId()); 67 } 68 69 72 public CustomerNormalValue( CustomerNormalValue otherValue ) 73 { 74 this.credit = otherValue.credit; 75 creditHasBeenSet = true; 76 this.array = otherValue.array; 77 arrayHasBeenSet = true; 78 this.image = otherValue.image; 79 imageHasBeenSet = true; 80 this.tax = otherValue.tax; 81 taxHasBeenSet = true; 82 this.id = otherValue.id; 83 idHasBeenSet = true; 84 this.name = otherValue.name; 85 nameHasBeenSet = true; 86 this.firstName = otherValue.firstName; 87 firstNameHasBeenSet = true; 88 this.AccountViews.addAll(otherValue.AccountViews); 89 this.ShippingAddressValues.addAll(otherValue.ShippingAddressValues); 90 91 primaryKey = new test.interfaces.CustomerPK(this.getId()); 92 } 93 94 public test.interfaces.CustomerPK getPrimaryKey() 95 { 96 return primaryKey; 97 } 98 99 public void setPrimaryKey( test.interfaces.CustomerPK primaryKey) 100 { 101 this.primaryKey = primaryKey; 104 setId( primaryKey.id ); 105 } 106 107 public float getCredit() 108 { 109 return this.credit; 110 } 111 112 public void setCredit( float credit ) 113 { 114 this.credit = credit; 115 creditHasBeenSet = true; 116 117 } 118 119 public boolean creditHasBeenSet(){ 120 return creditHasBeenSet; 121 } 122 public java.lang.String [][] getArray() 123 { 124 return this.array; 125 } 126 127 private void setArray( java.lang.String [][] array ) 128 { 129 this.array = array; 130 arrayHasBeenSet = true; 131 132 } 133 134 public byte[] getImage() 135 { 136 return this.image; 137 } 138 139 private void setImage( byte[] image ) 140 { 141 this.image = image; 142 imageHasBeenSet = true; 143 144 } 145 146 public float getTax() 147 { 148 return this.tax; 149 } 150 151 private void setTax( float tax ) 152 { 153 this.tax = tax; 154 taxHasBeenSet = true; 155 156 } 157 158 public java.lang.String getId() 159 { 160 return this.id; 161 } 162 163 public void setId( java.lang.String id ) 164 { 165 this.id = id; 166 idHasBeenSet = true; 167 168 primaryKey.setId(id); 169 } 170 171 public boolean idHasBeenSet(){ 172 return idHasBeenSet; 173 } 174 public java.lang.String getName() 175 { 176 return this.name; 177 } 178 179 public void setName( java.lang.String name ) 180 { 181 this.name = name; 182 nameHasBeenSet = true; 183 184 } 185 186 public boolean nameHasBeenSet(){ 187 return nameHasBeenSet; 188 } 189 public java.lang.String getFirstName() 190 { 191 return this.firstName; 192 } 193 194 public void setFirstName( java.lang.String firstName ) 195 { 196 this.firstName = firstName; 197 firstNameHasBeenSet = true; 198 199 } 200 201 public boolean firstNameHasBeenSet(){ 202 return firstNameHasBeenSet; 203 } 204 205 protected java.util.Collection addedAccountViews = wrapCollection(new java.util.ArrayList ()); 206 protected java.util.Collection onceAddedAccountViews = wrapCollection(new java.util.ArrayList ()); 207 protected java.util.Collection removedAccountViews = wrapCollection(new java.util.ArrayList ()); 208 protected java.util.Collection updatedAccountViews = wrapCollection(new java.util.ArrayList ()); 209 210 213 public java.util.Collection getAddedAccountViews() { return wrapReadOnly(addedAccountViews); } 214 215 218 public java.util.Collection getOnceAddedAccountViews() { return wrapReadOnly(onceAddedAccountViews); } 219 222 public java.util.Collection getRemovedAccountViews() { return wrapReadOnly(removedAccountViews); } 223 226 public java.util.Collection getUpdatedAccountViews() { return wrapReadOnly(updatedAccountViews); } 227 230 public java.util.Collection getAccountViewCollection() { return wrapReadOnly(AccountViews); } 231 232 247 public void setAddedAccountViews(java.util.Collection addedAccountViews) 248 { 249 java.util.List tempList = java.util.Arrays.asList(addedAccountViews.toArray()); 251 this.addedAccountViews.clear(); 252 this.addedAccountViews.addAll(tempList); 253 } 254 255 270 public void setOnceAddedAccountViews(java.util.Collection onceAddedAccountViews) 271 { 272 java.util.List tempList = java.util.Arrays.asList(onceAddedAccountViews.toArray()); 274 this.onceAddedAccountViews.clear(); 275 this.onceAddedAccountViews.addAll(tempList); 276 } 277 278 293 public void setRemovedAccountViews(java.util.Collection removedAccountViews) 294 { 295 java.util.List tempList = java.util.Arrays.asList(removedAccountViews.toArray()); 297 this.removedAccountViews.clear(); 298 this.removedAccountViews.addAll(tempList); 299 } 300 301 316 public void setUpdatedAccountViews(java.util.Collection updatedAccountViews) 317 { 318 java.util.List tempList = java.util.Arrays.asList(updatedAccountViews.toArray()); 320 this.updatedAccountViews.clear(); 321 this.updatedAccountViews.addAll(tempList); 322 } 323 324 334 public test.interfaces.AccountValue[] getAccountViews() 335 { 336 return (test.interfaces.AccountValue[])this.AccountViews.toArray(new test.interfaces.AccountValue[AccountViews.size()]); 337 } 338 339 349 public void setAccountViews(test.interfaces.AccountValue[] AccountViews) 350 { 351 this.AccountViews.clear(); 352 for (int i=0; i < AccountViews.length; i++) { 353 this.AccountViews.add(AccountViews[i]); 354 } 355 } 356 357 public void clearAccountViews() 358 { 359 this.AccountViews.clear(); 360 } 361 362 370 public void addAccountView(test.interfaces.AccountValue added) 371 { 372 this.AccountViews.add(added); 373 374 if (this.removedAccountViews.contains(added)) 375 { 376 this.removedAccountViews.remove(added); 377 if (this.onceAddedAccountViews.contains(added)) 378 { 379 if (! this.addedAccountViews.contains(added)) 380 this.addedAccountViews.add(added); 381 } 382 else if (! this.updatedAccountViews.contains(added)) 383 { 384 this.updatedAccountViews.add(added); 385 } 386 } 387 else 388 { 389 if (! this.onceAddedAccountViews.contains(added)) 390 this.onceAddedAccountViews.add(added); 391 if (! this.addedAccountViews.contains(added)) 392 this.addedAccountViews.add(added); 393 } 394 } 395 396 403 public void removeAccountView(test.interfaces.AccountValue removed) 404 { 405 this.AccountViews.remove(removed); 406 407 if (this.addedAccountViews.contains(removed)) 408 this.addedAccountViews.remove(removed); 409 else if (! this.removedAccountViews.contains(removed)) 410 this.removedAccountViews.add(removed); 411 412 if (this.updatedAccountViews.contains(removed)) 413 this.updatedAccountViews.remove(removed); 414 } 415 416 public void updateAccountView(test.interfaces.AccountValue updated) 417 { 418 if ( !this.updatedAccountViews.contains(updated) && !this.addedAccountViews.contains(updated)) 419 this.updatedAccountViews.add(updated); 420 421 if (this.removedAccountViews.contains(updated)) 422 this.removedAccountViews.remove(updated); 423 } 424 425 public void cleanAccountView(){ 426 this.addedAccountViews.clear(); 427 this.onceAddedAccountViews.clear(); 428 this.removedAccountViews.clear(); 429 this.updatedAccountViews.clear(); 430 } 431 432 public void copyAccountViewsFrom(test.interfaces.CustomerNormalValue from) 433 { 434 this.AccountViews.clear(); 435 this.AccountViews.addAll(from.AccountViews); 436 } 437 protected java.util.Collection addedShippingAddressValues = wrapCollection(new java.util.ArrayList ()); 438 protected java.util.Collection onceAddedShippingAddressValues = wrapCollection(new java.util.ArrayList ()); 439 protected java.util.Collection removedShippingAddressValues = wrapCollection(new java.util.ArrayList ()); 440 protected java.util.Collection updatedShippingAddressValues = wrapCollection(new java.util.ArrayList ()); 441 442 445 public java.util.Collection getAddedShippingAddressValues() { return wrapReadOnly(addedShippingAddressValues); } 446 447 450 public java.util.Collection getOnceAddedShippingAddressValues() { return wrapReadOnly(onceAddedShippingAddressValues); } 451 454 public java.util.Collection getRemovedShippingAddressValues() { return wrapReadOnly(removedShippingAddressValues); } 455 458 public java.util.Collection getUpdatedShippingAddressValues() { return wrapReadOnly(updatedShippingAddressValues); } 459 462 public java.util.Collection getShippingAddressValueCollection() { return wrapReadOnly(ShippingAddressValues); } 463 464 479 public void setAddedShippingAddressValues(java.util.Collection addedShippingAddressValues) 480 { 481 java.util.List tempList = java.util.Arrays.asList(addedShippingAddressValues.toArray()); 483 this.addedShippingAddressValues.clear(); 484 this.addedShippingAddressValues.addAll(tempList); 485 } 486 487 502 public void setOnceAddedShippingAddressValues(java.util.Collection onceAddedShippingAddressValues) 503 { 504 java.util.List tempList = java.util.Arrays.asList(onceAddedShippingAddressValues.toArray()); 506 this.onceAddedShippingAddressValues.clear(); 507 this.onceAddedShippingAddressValues.addAll(tempList); 508 } 509 510 525 public void setRemovedShippingAddressValues(java.util.Collection removedShippingAddressValues) 526 { 527 java.util.List tempList = java.util.Arrays.asList(removedShippingAddressValues.toArray()); 529 this.removedShippingAddressValues.clear(); 530 this.removedShippingAddressValues.addAll(tempList); 531 } 532 533 548 public void setUpdatedShippingAddressValues(java.util.Collection updatedShippingAddressValues) 549 { 550 java.util.List tempList = java.util.Arrays.asList(updatedShippingAddressValues.toArray()); 552 this.updatedShippingAddressValues.clear(); 553 this.updatedShippingAddressValues.addAll(tempList); 554 } 555 556 566 public test.interfaces.AddressValue[] getShippingAddressValues() 567 { 568 return (test.interfaces.AddressValue[])this.ShippingAddressValues.toArray(new test.interfaces.AddressValue[ShippingAddressValues.size()]); 569 } 570 571 581 public void setShippingAddressValues(test.interfaces.AddressValue[] ShippingAddressValues) 582 { 583 this.ShippingAddressValues.clear(); 584 for (int i=0; i < ShippingAddressValues.length; i++) { 585 this.ShippingAddressValues.add(ShippingAddressValues[i]); 586 } 587 } 588 589 public void clearShippingAddressValues() 590 { 591 this.ShippingAddressValues.clear(); 592 } 593 594 602 public void addShippingAddressValue(test.interfaces.AddressValue added) 603 { 604 this.ShippingAddressValues.add(added); 605 606 if (this.removedShippingAddressValues.contains(added)) 607 { 608 this.removedShippingAddressValues.remove(added); 609 if (this.onceAddedShippingAddressValues.contains(added)) 610 { 611 if (! this.addedShippingAddressValues.contains(added)) 612 this.addedShippingAddressValues.add(added); 613 } 614 else if (! this.updatedShippingAddressValues.contains(added)) 615 { 616 this.updatedShippingAddressValues.add(added); 617 } 618 } 619 else 620 { 621 if (! this.onceAddedShippingAddressValues.contains(added)) 622 this.onceAddedShippingAddressValues.add(added); 623 if (! this.addedShippingAddressValues.contains(added)) 624 this.addedShippingAddressValues.add(added); 625 } 626 } 627 628 635 public void removeShippingAddressValue(test.interfaces.AddressValue removed) 636 { 637 this.ShippingAddressValues.remove(removed); 638 639 if (this.addedShippingAddressValues.contains(removed)) 640 this.addedShippingAddressValues.remove(removed); 641 else if (! this.removedShippingAddressValues.contains(removed)) 642 this.removedShippingAddressValues.add(removed); 643 644 if (this.updatedShippingAddressValues.contains(removed)) 645 this.updatedShippingAddressValues.remove(removed); 646 } 647 648 public void updateShippingAddressValue(test.interfaces.AddressValue updated) 649 { 650 if ( !this.updatedShippingAddressValues.contains(updated) && !this.addedShippingAddressValues.contains(updated)) 651 this.updatedShippingAddressValues.add(updated); 652 653 if (this.removedShippingAddressValues.contains(updated)) 654 this.removedShippingAddressValues.remove(updated); 655 } 656 657 public void cleanShippingAddressValue(){ 658 this.addedShippingAddressValues.clear(); 659 this.onceAddedShippingAddressValues.clear(); 660 this.removedShippingAddressValues.clear(); 661 this.updatedShippingAddressValues.clear(); 662 } 663 664 public void copyShippingAddressValuesFrom(test.interfaces.CustomerNormalValue from) 665 { 666 this.ShippingAddressValues.clear(); 667 this.ShippingAddressValues.addAll(from.ShippingAddressValues); 668 } 669 670 public int getVersion() 671 { 672 return _version; 673 } 674 public void setVersion(int version) 675 { 676 this._version = version; 677 } 678 679 public String toString() 680 { 681 StringBuffer str = new StringBuffer ("{"); 682 683 str.append("credit=" + getCredit() + " " + "array=" + getArray() + " " + "image=" + getImage() + " " + "tax=" + getTax() + " " + "id=" + getId() + " " + "name=" + getName() + " " + "firstName=" + getFirstName()); 684 str.append(",version="); 685 str.append(_version); 686 str.append('}'); 687 688 return(str.toString()); 689 } 690 691 696 protected boolean hasIdentity() 697 { 698 boolean ret = true; 699 ret = ret && idHasBeenSet; 700 return ret; 701 } 702 703 707 public boolean isIdentical(Object other) 708 { 709 if (other instanceof CustomerNormalValue) 710 { 711 CustomerNormalValue that = (CustomerNormalValue) other; 712 boolean lEquals = true; 713 lEquals = lEquals && this.credit == that.credit; 714 if( this.array == null ) 715 { 716 lEquals = lEquals && ( that.array == null ); 717 } 718 else 719 { 720 lEquals = lEquals && this.array.equals( that.array ); 721 } 722 lEquals = lEquals && this.image == that.image; 723 lEquals = lEquals && this.tax == that.tax; 724 if( this.name == null ) 725 { 726 lEquals = lEquals && ( that.name == null ); 727 } 728 else 729 { 730 lEquals = lEquals && this.name.equals( that.name ); 731 } 732 if( this.firstName == null ) 733 { 734 lEquals = lEquals && ( that.firstName == null ); 735 } 736 else 737 { 738 lEquals = lEquals && this.firstName.equals( that.firstName ); 739 } 740 if( this.getAccountViews() == null ) 741 { 742 lEquals = lEquals && ( that.getAccountViews() == null ); 743 } 744 else 745 { 746 lEquals = lEquals && java.util.Arrays.equals(this.getAccountViews() , that.getAccountViews()) ; 747 } 748 if( this.getShippingAddressValues() == null ) 749 { 750 lEquals = lEquals && ( that.getShippingAddressValues() == null ); 751 } 752 else 753 { 754 lEquals = lEquals && java.util.Arrays.equals(this.getShippingAddressValues() , that.getShippingAddressValues()) ; 755 } 756 757 return lEquals; 758 } 759 else 760 { 761 return false; 762 } 763 } 764 765 public boolean equals(Object other) { 766 767 if (!(other instanceof CustomerNormalValue)) { 769 return false; 770 } 771 772 return equals((CustomerNormalValue) other); 773 } 774 775 780 public boolean equals(CustomerNormalValue that) { 781 782 if (this == that) { 784 return true; 785 } 786 if(null == that) { 788 return false; 789 } 790 791 if(this.credit != that.credit) { 792 return false; 793 } 794 795 if(this.array != that.array) { 796 797 if( this.array == null || that.array == null ) { 798 return false; 799 } 800 801 if(!this.array.equals(that.array)) { 802 return false; 803 } 804 805 } 806 807 if(!java.util.Arrays.equals(this.image, that.image)) { 808 return false; 809 } 810 811 if(this.tax != that.tax) { 812 return false; 813 } 814 815 if(this.id != that.id) { 816 817 if( this.id == null || that.id == null ) { 818 return false; 819 } 820 821 if(!this.id.equals(that.id)) { 822 return false; 823 } 824 825 } 826 827 if(this.name != that.name) { 828 829 if( this.name == null || that.name == null ) { 830 return false; 831 } 832 833 if(!this.name.equals(that.name)) { 834 return false; 835 } 836 837 } 838 839 if(this.firstName != that.firstName) { 840 841 if( this.firstName == null || that.firstName == null ) { 842 return false; 843 } 844 845 if(!this.firstName.equals(that.firstName)) { 846 return false; 847 } 848 849 } 850 851 858 return true; 859 860 } 861 862 public Object clone() throws java.lang.CloneNotSupportedException { 863 CustomerNormalValue other = (CustomerNormalValue) super.clone(); 864 865 { 866 java.util.Collection tempData; 868 tempData = wrapCollection(new java.util.ArrayList ()); 869 tempData.addAll(this.AccountViews); 870 this.AccountViews = tempData; 871 tempData = wrapCollection(new java.util.ArrayList ()); 872 tempData.addAll(this.addedAccountViews); 873 this.addedAccountViews = tempData; 874 tempData = wrapCollection(new java.util.ArrayList ()); 875 tempData.addAll(this.onceAddedAccountViews); 876 this.onceAddedAccountViews = tempData; 877 tempData = wrapCollection(new java.util.ArrayList ()); 878 tempData.addAll(this.removedAccountViews); 879 this.removedAccountViews = tempData; 880 tempData = wrapCollection(new java.util.ArrayList ()); 881 tempData.addAll(this.updatedAccountViews); 882 this.updatedAccountViews = tempData; 883 } 884 { 885 java.util.Collection tempData; 887 tempData = wrapCollection(new java.util.ArrayList ()); 888 tempData.addAll(this.ShippingAddressValues); 889 this.ShippingAddressValues = tempData; 890 tempData = wrapCollection(new java.util.ArrayList ()); 891 tempData.addAll(this.addedShippingAddressValues); 892 this.addedShippingAddressValues = tempData; 893 tempData = wrapCollection(new java.util.ArrayList ()); 894 tempData.addAll(this.onceAddedShippingAddressValues); 895 this.onceAddedShippingAddressValues = tempData; 896 tempData = wrapCollection(new java.util.ArrayList ()); 897 tempData.addAll(this.removedShippingAddressValues); 898 this.removedShippingAddressValues = tempData; 899 tempData = wrapCollection(new java.util.ArrayList ()); 900 tempData.addAll(this.updatedShippingAddressValues); 901 this.updatedShippingAddressValues = tempData; 902 } 903 904 return other; 905 } 906 907 public ReadOnlyCustomerNormalValue getReadOnlyCustomerNormalValue() { 908 return new ReadOnlyCustomerNormalValue(); 909 } 910 911 public int hashCode(){ 912 int result = 17; 913 result = 37*result + Float.floatToIntBits(credit); 914 915 result = 37*result + ((this.array != null) ? this.array.hashCode() : 0); 916 917 if (image != null) { 918 for (int i=0; i<image.length; i++) 919 { 920 long l = image[i]; 921 result = 37*result + (int)(l^(l>>>32)); 922 } 923 } 924 925 result = 37*result + Float.floatToIntBits(tax); 926 927 result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); 928 929 result = 37*result + ((this.name != null) ? this.name.hashCode() : 0); 930 931 result = 37*result + ((this.firstName != null) ? this.firstName.hashCode() : 0); 932 933 940 return result; 941 } 942 943 950 private static java.util.Collection wrapCollection(java.util.Collection input) { 951 return java.util.Collections.synchronizedCollection(input); 952 } 953 960 private static java.util.Set wrapCollection(java.util.Set input) { 961 return java.util.Collections.synchronizedSet(input); 962 } 963 969 private static java.util.Collection wrapReadOnly(java.util.Collection input) { 970 return java.util.Collections.unmodifiableCollection(input); 971 } 972 978 private static java.util.Set wrapReadOnly(java.util.Set input) { 979 return java.util.Collections.unmodifiableSet(input); 980 } 981 982 private final class ReadOnlyCustomerNormalValue 983 implements java.lang.Cloneable , java.io.Serializable 984 { 985 private CustomerNormalValue underlying() { 986 return CustomerNormalValue.this; 987 } 988 989 public float getCredit() { 990 return underlying().credit; 991 } 992 993 public java.lang.String [][] getArray() { 994 return underlying().array; 995 } 996 997 public byte[] getImage() { 998 return underlying().image; 999 } 1000 1001 public float getTax() { 1002 return underlying().tax; 1003 } 1004 1005 public java.lang.String getId() { 1006 return underlying().id; 1007 } 1008 1009 public java.lang.String getName() { 1010 return underlying().name; 1011 } 1012 1013 public java.lang.String getFirstName() { 1014 return underlying().firstName; 1015 } 1016 1017 public java.util.Collection getAddedAccountViews() { 1018 return underlying().getAddedAccountViews(); 1019 } 1020 public java.util.Collection getOnceAddedAccountViews() { 1021 return underlying().getOnceAddedAccountViews(); 1022 } 1023 public java.util.Collection getRemovedAccountViews() { 1024 return underlying().getRemovedAccountViews(); 1025 } 1026 public java.util.Collection getUpdatedAccountViews() { 1027 return underlying().getUpdatedAccountViews(); 1028 } 1029 public java.util.Collection getAccountViewCollection() { 1030 return underlying().getAccountViewCollection(); 1031 } 1032 public java.util.Collection getAddedShippingAddressValues() { 1033 return underlying().getAddedShippingAddressValues(); 1034 } 1035 public java.util.Collection getOnceAddedShippingAddressValues() { 1036 return underlying().getOnceAddedShippingAddressValues(); 1037 } 1038 public java.util.Collection getRemovedShippingAddressValues() { 1039 return underlying().getRemovedShippingAddressValues(); 1040 } 1041 public java.util.Collection getUpdatedShippingAddressValues() { 1042 return underlying().getUpdatedShippingAddressValues(); 1043 } 1044 public java.util.Collection getShippingAddressValueCollection() { 1045 return underlying().getShippingAddressValueCollection(); 1046 } 1047 1048 public int hashCode() { 1049 return 101 * underlying().hashCode(); 1050 } 1051 1052 public boolean equals(Object o) { 1053 if(o instanceof ReadOnlyCustomerNormalValue) { 1054 return this.equals((ReadOnlyCustomerNormalValue) o); 1055 } 1056 return false; 1057 } 1058 1059 public boolean equals(ReadOnlyCustomerNormalValue that) { 1060 if(null == that) { 1061 return false; 1062 } 1063 1064 return this.underlying().equals(that.underlying()); 1065 } 1066 1067 } 1068 1069} 1070 | Popular Tags |