1 package sellwin.domain; 2 3 import java.util.*; 4 import java.io.*; 5 import java.text.*; 6 import javax.swing.text.*; 7 8 12 13 18 public class Contact implements Serializable { 19 private long pk; 20 private long oppPK; 21 private long addressPK; 22 private Address address; 23 private String modifiedBy; 24 private Date modifiedDate; 25 private boolean updatedLocally=false; 26 private boolean addedLocally=false; 27 28 29 public Contact() { 30 modifiedDate = new Date(); 31 } 32 33 public final void setPK(long pk) { this.pk = pk; } 34 public final long getPK() { return pk; } 35 36 public final void setOppKey(long pk) { this.oppPK = pk; } 37 public final long getOppKey() { return oppPK; } 38 39 public final void setAddressKey(long pk) { this.addressPK = pk; } 40 public final long getAddressKey() { return addressPK; } 41 42 public final void setAddress(Address a) { address = a; } 43 public final Address getAddress() { return address; } 44 45 public final void setModifiedBy(String s) { modifiedBy = s; } 46 public final String getModifiedBy() { return modifiedBy; } 47 48 public final void setModifiedDate(Date s) { modifiedDate = s; } 49 public final Date getModifiedDate() { return modifiedDate; } 50 51 public final void setUpdatedLocally(boolean b) { 52 updatedLocally=b; 53 } 54 public final void setAddedLocally(boolean b) { 55 addedLocally=b; 56 } 57 public final boolean getAddedLocally() { return addedLocally; } 58 public final boolean getUpdatedLocally() { return updatedLocally; } 59 60 public final Contact copy() { 61 Contact copy = new Contact(); 62 copy.pk = pk; 63 copy.oppPK = oppPK; 64 copy.addressPK = addressPK; 65 copy.modifiedDate = new Date(modifiedDate.getTime()); 66 copy.modifiedBy = new String (modifiedBy); 67 68 return copy; 69 70 } 71 72 public final void print() { 73 System.out.println("<<Contact>>"); 74 System.out.println("pk=["+getPK()+"]"); 75 System.out.println("opppk=["+getOppKey()+"]"); 76 System.out.println("addresspk=["+getAddressKey()+"]"); 77 System.out.println("ModifiedBy="+ getModifiedBy()); 78 System.out.println("ModifiedDate="+ getModifiedDate()); 79 } 80 81 public static void copyFields(Contact to, Contact from) { 82 Address.copyFields(to.getAddress(), from.getAddress()); 83 } 84 } 85 | Popular Tags |