| 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 17 public class Lead implements Serializable { 18 private long pk; 19 private long campaignKey; 20 private Address address; 21 private String company; 22 private String interestLevel; 23 private SalesPerson contactedBy; 24 private Date contactDate; 25 private Boolean convertedToOpp; 26 private String modifiedBy; 27 private Date modifiedDate; 28 private boolean updatedLocally=false; 29 private boolean addedLocally=false; 30 31 public Lead() { 32 pk=0; campaignKey=0; 33 address = new Address(); 34 company=""; 35 interestLevel=""; 36 contactedBy = new SalesPerson(); 37 contactDate = null; 38 convertedToOpp = new Boolean (false); 39 modifiedDate = new Date(); 40 modifiedBy = ""; 41 } 42 43 public final void setPK(long pk) { this.pk = pk; } 44 public final void setCampaignKey(long pk) { campaignKey = pk; } 45 public final void setAddress(Address n) { address = n;} 46 public final void setCompany(String t) { company = t; } 47 public final void setInterestLevel(String d) { interestLevel=d; } 48 public final void setContactedBy(SalesPerson d) { contactedBy=d; } 49 public final void setContactDate(Date d) { contactDate = d; } 50 public final void setConverted(Boolean d) { convertedToOpp = d; } 51 public final void setModifiedDate(Date d) { modifiedDate = d; } 52 public final void setModifiedBy(String d) { modifiedBy = d; } 53 public final void setUpdatedLocally(boolean b) { updatedLocally=b; } 54 public final void setAddedLocally(boolean b) { addedLocally=b; } 55 56 public final long getPK() { return pk; } 57 public final long getCampaignKey() { return campaignKey; } 58 public final Address getAddress() { return address; } 59 public final String getCompany() { return company; } 60 public final String getInterestLevel() { return interestLevel; } 61 public final SalesPerson getContactedBy() { return contactedBy; } 62 public final Date getContactDate() { return contactDate; } 63 public final Boolean getConverted() { return convertedToOpp; } 64 public final Date getModifiedDate() { return modifiedDate; } 65 public final String getModifiedBy() { return modifiedBy; } 66 public final boolean getUpdatedLocally() { return updatedLocally; } 67 public final boolean getAddedLocally() { return addedLocally; } 68 69 70 public final Lead copy() { 71 Lead copy = new Lead(); 72 copy.setPK(getPK()); 73 if (address != null) 74 copy.address = address.copy(); 75 if (company != null) 76 copy.company = new String (company); 77 if (interestLevel != null) 78 copy.interestLevel = new String (interestLevel); 79 if (contactedBy != null) 80 copy.contactedBy = contactedBy.copy(); 81 if (contactDate != null) 82 copy.contactDate = new Date(contactDate.getTime()); 83 copy.convertedToOpp = new Boolean (convertedToOpp.booleanValue()); 84 if (modifiedBy != null) 85 copy.modifiedBy = new String (modifiedBy); 86 copy.modifiedDate = new Date(modifiedDate.getTime()); 87 88 return copy; 89 } 90 91 public final void print() { 92 System.out.println("<<Lead>>"); 93 System.out.println("pk=["+getPK()+"]"); 94 address.print(); 95 System.out.println("company=["+getCompany()+"]"); 96 System.out.println("InterestLevel="+getInterestLevel()); 97 contactedBy.print(); 98 System.out.println("ContactDate="+getContactDate()); 99 System.out.println("Converted="+getConverted()); 100 System.out.println("Modified By/Date="+modifiedBy + modifiedDate); 101 } 102 } 103 | Popular Tags |