KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > domain > Lead


1 package sellwin.domain;
2
3 import java.util.*;
4 import java.io.*;
5 import java.text.*;
6 import javax.swing.text.*;
7
8 // SellWin http://sourceforge.net/projects/sellwincrm
9
//Contact support@open-app.com for commercial help with SellWin
10
//This software is provided "AS IS", without a warranty of any kind.
11

12
13 /**
14  * This class represents a 'lead' in SellWin. A lead
15  * is stored in the 'lead' table in the database.
16  */

17 public class Lead implements Serializable {
18     private long pk;
19     private long campaignKey;
20     private Address address;
21     private String JavaDoc company;
22     private String JavaDoc interestLevel;
23     private SalesPerson contactedBy;
24     private Date contactDate;
25     private Boolean JavaDoc convertedToOpp;
26     private String JavaDoc 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 JavaDoc(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 JavaDoc t) { company = t; }
47     public final void setInterestLevel(String JavaDoc 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 JavaDoc d) { convertedToOpp = d; }
51     public final void setModifiedDate(Date d) { modifiedDate = d; }
52     public final void setModifiedBy(String JavaDoc 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 JavaDoc getCompany() { return company; }
60     public final String JavaDoc getInterestLevel() { return interestLevel; }
61     public final SalesPerson getContactedBy() { return contactedBy; }
62     public final Date getContactDate() { return contactDate; }
63     public final Boolean JavaDoc getConverted() { return convertedToOpp; }
64     public final Date getModifiedDate() { return modifiedDate; }
65     public final String JavaDoc 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 JavaDoc(company);
77         if (interestLevel != null)
78             copy.interestLevel = new String JavaDoc(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 JavaDoc(convertedToOpp.booleanValue());
84         if (modifiedBy != null)
85             copy.modifiedBy = new String JavaDoc(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