View Javadoc

1   package org.kuali.ole.patron.bo;
2   
3   import org.apache.commons.collections.CollectionUtils;
4   import org.kuali.ole.patron.api.OlePatronAffiliationDefinition;
5   import org.kuali.ole.patron.api.OleProxyPatronContract;
6   import org.kuali.ole.patron.api.OleProxyPatronDefinition;
7   import org.kuali.rice.kim.api.identity.employment.EntityEmployment;
8   import org.kuali.rice.kim.impl.identity.affiliation.EntityAffiliationTypeBo;
9   import org.kuali.rice.kim.impl.identity.employment.EntityEmploymentBo;
10  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
11  
12  import java.util.Date;
13  
14  /**
15   OleProxyPatronDocument provides OleProxyPatronDocument information through getter and setter.
16   */
17  public class OleProxyPatronDocument extends PersistableBusinessObjectBase implements OleProxyPatronContract{
18  
19      private String oleProxyPatronDocumentId;
20      private String proxyPatronId;
21      private String olePatronId;
22      private Date proxyPatronExpirationDate;
23      private Date proxyPatronActivationDate;
24      private boolean active;
25  
26      private String proxyBarcode;
27      private String proxyFirstName;
28      private String proxyLastName;
29      //private OlePatronDocument proxyPatron;
30      private OlePatronDocument olePatronDocument;
31  
32      /**
33       * Gets the value of proxyBarcode property
34       * @return proxyBarcode
35       */
36      public String getProxyBarcode() {
37          return proxyBarcode;
38      }
39      /**
40       * Sets the value for proxyBarcode property
41       * @param proxyBarcode
42       */
43      public void setProxyBarcode(String proxyBarcode) {
44          this.proxyBarcode = proxyBarcode;
45      }
46      /**
47       * Gets the value of proxyFirstName property
48       * @return proxyFirstName
49       */
50      public String getProxyFirstName() {
51          return proxyFirstName;
52      }
53      /**
54       * Sets the value for proxyFirstName property
55       * @param proxyFirstName
56       */
57      public void setProxyFirstName(String proxyFirstName) {
58          this.proxyFirstName = proxyFirstName;
59      }
60      /**
61       * Gets the value of proxyLastName property
62       * @return proxyLastName
63       */
64      public String getProxyLastName() {
65          return proxyLastName;
66      }
67      /**
68       * Sets the value for proxyLastName property
69       * @param proxyLastName
70       */
71      public void setProxyLastName(String proxyLastName) {
72          this.proxyLastName = proxyLastName;
73      }
74      /**
75       * Gets the value of oleProxyPatronDocumentId property
76       * @return oleProxyPatronDocumentId
77       */
78      public String getOleProxyPatronDocumentId() {
79          return oleProxyPatronDocumentId;
80      }
81      /**
82       * Sets the value for oleProxyPatronDocumentId property
83       * @param oleProxyPatronDocumentId
84       */
85      public void setOleProxyPatronDocumentId(String oleProxyPatronDocumentId) {
86          this.oleProxyPatronDocumentId = oleProxyPatronDocumentId;
87      }
88      /**
89       * Gets the value of proxyPatronId property
90       * @return proxyPatronId
91       */
92      public String getProxyPatronId() {
93          return proxyPatronId;
94      }
95      /**
96       * Sets the value for proxyPatronId property
97       * @param proxyPatronId
98       */
99      public void setProxyPatronId(String proxyPatronId) {
100         this.proxyPatronId = proxyPatronId;
101     }
102     /**
103      * Gets the value of olePatronId property
104      * @return olePatronId
105      */
106     public String getOlePatronId() {
107         return olePatronId;
108     }
109     /**
110      * Sets the value for olePatronId property
111      * @param olePatronId
112      */
113     public void setOlePatronId(String olePatronId) {
114         this.olePatronId = olePatronId;
115     }
116 
117    /* public OlePatronDocument getProxyPatron() {
118         return proxyPatron;
119     }
120 
121     public void setProxyPatron(OlePatronDocument proxyPatron) {
122         this.proxyPatron = proxyPatron;
123     }*/
124     /**
125      * Gets the value of olePatronDocument property
126      * @return olePatronDocument
127      */
128     public OlePatronDocument getOlePatronDocument() {
129         return olePatronDocument;
130     }
131     /**
132      * Sets the value for olePatronDocument property
133      * @param olePatronDocument
134      */
135     public void setOlePatronDocument(OlePatronDocument olePatronDocument) {
136         this.olePatronDocument = olePatronDocument;
137     }
138     /**
139      * Gets the value of proxyPatronExpirationDate property
140      * @return proxyPatronExpirationDate
141      */
142     public Date getProxyPatronExpirationDate() {
143         return proxyPatronExpirationDate;
144     }
145     /**
146      * Sets the value for proxyPatronExpirationDate property
147      * @param proxyPatronExpirationDate
148      */
149     public void setProxyPatronExpirationDate(Date proxyPatronExpirationDate) {
150         this.proxyPatronExpirationDate = proxyPatronExpirationDate;
151     }
152     /**
153      * Gets the value of proxyPatronActivationDate property
154      * @return proxyPatronActivationDate
155      */
156     public Date getProxyPatronActivationDate() {
157         return proxyPatronActivationDate;
158     }
159     /**
160      * Sets the value for proxyPatronActivationDate property
161      * @param proxyPatronActivationDate
162      */
163     public void setProxyPatronActivationDate(Date proxyPatronActivationDate) {
164         this.proxyPatronActivationDate = proxyPatronActivationDate;
165     }
166     /**
167      * Gets the value of active property
168      * @return active
169      */
170     public boolean isActive() {
171         return active;
172     }
173     /**
174      * Sets the value for active property
175      * @param active
176      */
177     public void setActive(boolean active) {
178         this.active = active;
179     }
180 
181     /**
182      * This method converts the PersistableBusinessObjectBase OleProxyPatronDocument into immutable object OleProxyPatronDefinition
183      * @param bo(OleProxyPatronDefinition)
184      * @return OleProxyPatronDefinition
185      */
186     static OleProxyPatronDefinition to(OleProxyPatronDocument bo) {
187         if (bo == null) { return null; }
188         return OleProxyPatronDefinition.Builder.create(bo).build();
189     }
190 
191     /**
192      * This method converts the immutable object OleProxyPatronDefinition into PersistableBusinessObjectBase OleProxyPatronDocument
193      * @param im(OleProxyPatronDefinition)
194      * @return bo(OlePatronAffiliation)
195      */
196     public static OleProxyPatronDocument from(OleProxyPatronDefinition im) {
197         if (im == null) { return null; }
198 
199         OleProxyPatronDocument bo = new OleProxyPatronDocument();
200         bo.oleProxyPatronDocumentId= im.getOleProxyPatronDocumentId();
201         bo.olePatronId = im.getOlePatronId();
202         bo.proxyPatronId = im.getProxyPatronId();
203        /* if (im.getOlePatronDocument() != null) {
204             bo.olePatronDocument = OlePatronDocument.from(im.getOlePatronDocument());
205         }*/
206         bo.active = im.isActive();
207         bo.proxyPatronExpirationDate= im.getProxyPatronExpirationDate();
208         bo.proxyPatronActivationDate= im.getProxyPatronActivationDate();
209         bo.versionNumber = im.getVersionNumber();
210 
211 
212         return bo;
213     }
214 
215 
216     @Override
217     public String getId() {
218         return this.oleProxyPatronDocumentId;
219     }
220 }