View Javadoc
1   package org.kuali.ole.deliver.bo;
2   
3   import org.kuali.ole.deliver.api.OlePatronNotesContract;
4   import org.kuali.ole.deliver.api.OlePatronNotesDefinition;
5   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
6   
7   import java.util.LinkedHashMap;
8   
9   /**
10   * OlePatronNotes provides OlePatronNotes information through getter and setter.
11   */
12  public class OlePatronNotes extends PersistableBusinessObjectBase implements OlePatronNotesContract {
13  
14      private String patronNoteId;
15      private String olePatronId;
16      private String patronNoteTypeId;
17      private String patronNoteText;
18      private boolean active;
19      private OlePatronNoteType olePatronNoteType;
20      private OlePatronDocument olePatron;
21  
22      /**
23       * Gets the value of patronNoteId property
24       *
25       * @return patronNoteId
26       */
27      public String getPatronNoteId() {
28          return patronNoteId;
29      }
30  
31      /**
32       * Sets the value for patronNoteId property
33       *
34       * @param patronNoteId
35       */
36      public void setPatronNoteId(String patronNoteId) {
37          this.patronNoteId = patronNoteId;
38      }
39  
40      /**
41       * Gets the value of olePatronId property
42       *
43       * @return olePatronId
44       */
45      public String getOlePatronId() {
46          return olePatronId;
47      }
48  
49      /**
50       * Sets the value for olePatronId property
51       *
52       * @param olePatronId
53       */
54      public void setOlePatronId(String olePatronId) {
55          this.olePatronId = olePatronId;
56      }
57  
58      /**
59       * Gets the value of patronNoteTypeId property
60       *
61       * @return patronNoteTypeId
62       */
63      public String getPatronNoteTypeId() {
64          return patronNoteTypeId;
65      }
66  
67      /**
68       * Sets the value for patronNoteTypeId property
69       *
70       * @param patronNoteTypeId
71       */
72      public void setPatronNoteTypeId(String patronNoteTypeId) {
73          this.patronNoteTypeId = patronNoteTypeId;
74      }
75  
76      /**
77       * Gets the value of patronNoteText property
78       *
79       * @return patronNoteText
80       */
81      public String getPatronNoteText() {
82          return patronNoteText;
83      }
84  
85      /**
86       * Sets the value for patronNoteText property
87       *
88       * @param patronNoteText
89       */
90      public void setPatronNoteText(String patronNoteText) {
91          this.patronNoteText = patronNoteText;
92      }
93  
94      /**
95       * Gets the boolean value of active property
96       *
97       * @return active
98       */
99      public boolean isActive() {
100         return active;
101     }
102 
103     /**
104      * Sets the boolean value for active property
105      *
106      * @param active
107      */
108     public void setActive(boolean active) {
109         this.active = active;
110     }
111 
112     /**
113      * Gets the value of olePatronNoteType which is of type OlePatronNoteType
114      *
115      * @return olePatronNoteType(OlePatronNoteType)
116      */
117     public OlePatronNoteType getOlePatronNoteType() {
118         return olePatronNoteType;
119     }
120 
121     /**
122      * Sets the value for olePatronNoteType which is of type OlePatronNoteType
123      *
124      * @param olePatronNoteType(OlePatronNoteType)
125      *
126      */
127     public void setOlePatronNoteType(OlePatronNoteType olePatronNoteType) {
128         this.olePatronNoteType = olePatronNoteType;
129     }
130 
131     /**
132      * Gets the value of olePatron which is of type OlePatronDocument
133      *
134      * @return olePatron(OlePatronDocument)
135      */
136     public OlePatronDocument getOlePatron() {
137         return olePatron;
138     }
139 
140     /**
141      * Sets the value for olePatron which is of type OlePatronDocument
142      *
143      * @param olePatron(OlePatronDocument)
144      */
145     public void setOlePatron(OlePatronDocument olePatron) {
146         this.olePatron = olePatron;
147     }
148 
149     protected LinkedHashMap toStringMapper() {
150         LinkedHashMap toStringMap = new LinkedHashMap();
151         toStringMap.put("patronNoteId", patronNoteId);
152         return toStringMap;
153     }
154 
155     /**
156      * This method converts the PersistableBusinessObjectBase OlePatronNotes into immutable object OlePatronNotesDefinition
157      *
158      * @param bo
159      * @return OlePatronNotesDefinition
160      */
161     public static OlePatronNotesDefinition to(OlePatronNotes bo) {
162         if (bo == null) {
163             return null;
164         }
165         return OlePatronNotesDefinition.Builder.create(bo).build();
166     }
167 
168     /**
169      * This method converts the immutable object OlePatronNotesDefinition into PersistableBusinessObjectBase OlePatronNotes
170      *
171      * @param im
172      * @return bo
173      */
174     public static OlePatronNotes from(OlePatronNotesDefinition im) {
175         if (im == null) {
176             return null;
177         }
178 
179         OlePatronNotes bo = new OlePatronNotes();
180         bo.patronNoteId = im.getPatronNoteId();
181         bo.olePatronId = im.getOlePatronId();
182         //bo.olePatron = OlePatronDocument.from(im.getOlePatron());
183         bo.olePatronNoteType = OlePatronNoteType.from(im.getOlePatronNoteType());
184         bo.patronNoteTypeId = im.getOlePatronNoteType().getPatronNoteTypeId();
185         bo.patronNoteText = im.getPatronNoteText();
186         bo.versionNumber = im.getVersionNumber();
187         return bo;
188     }
189 
190     /**
191      * Gets the value of patronNoteId property
192      *
193      * @return patronNoteId
194      */
195     @Override
196     public String getId() {
197         return this.getPatronNoteId();
198     }
199 
200 }