View Javadoc

1   package org.kuali.ole.patron.bo;
2   
3   import org.kuali.ole.patron.api.OlePatronNotesContract;
4   import org.kuali.ole.patron.api.OlePatronNotesDefinition;
5   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
6   
7   import java.io.Serializable;
8   import java.util.LinkedHashMap;
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       * @return patronNoteId
25       */
26      public String getPatronNoteId() {
27          return patronNoteId;
28      }
29      /**
30       * Sets the value for patronNoteId property
31       * @param patronNoteId
32       */
33      public void setPatronNoteId(String patronNoteId) {
34          this.patronNoteId = patronNoteId;
35      }
36      /**
37       * Gets the value of olePatronId property
38       * @return olePatronId
39       */
40      public String getOlePatronId() {
41          return olePatronId;
42      }
43      /**
44       * Sets the value for olePatronId property
45       * @param olePatronId
46       */
47      public void setOlePatronId(String olePatronId) {
48          this.olePatronId = olePatronId;
49      }
50      /**
51       * Gets the value of patronNoteTypeId property
52       * @return patronNoteTypeId
53       */
54      public String getPatronNoteTypeId() {
55          return patronNoteTypeId;
56      }
57      /**
58       * Sets the value for patronNoteTypeId property
59       * @param patronNoteTypeId
60       */
61      public void setPatronNoteTypeId(String patronNoteTypeId) {
62          this.patronNoteTypeId = patronNoteTypeId;
63      }
64      /**
65       * Gets the value of patronNoteText property
66       * @return patronNoteText
67       */
68      public String getPatronNoteText() {
69          return patronNoteText;
70      }
71      /**
72       * Sets the value for patronNoteText property
73       * @param patronNoteText
74       */
75      public void setPatronNoteText(String patronNoteText) {
76          this.patronNoteText = patronNoteText;
77      }
78      /**
79       * Gets the boolean value of active property
80       * @return active
81       */
82      public boolean isActive() {
83          return active;
84      }
85      /**
86       * Sets the boolean value for active property
87       * @param active
88       */
89      public void setActive(boolean active) {
90          this.active = active;
91      }
92      /**
93       * Gets the value of olePatronNoteType which is of type OlePatronNoteType
94       * @return olePatronNoteType(OlePatronNoteType)
95       */
96      public OlePatronNoteType getOlePatronNoteType() {
97          return olePatronNoteType;
98      }
99      /**
100      * Sets the value for olePatronNoteType which is of type OlePatronNoteType
101      * @param olePatronNoteType(OlePatronNoteType)
102      */
103     public void setOlePatronNoteType(OlePatronNoteType olePatronNoteType) {
104         this.olePatronNoteType = olePatronNoteType;
105     }
106     /**
107      * Gets the value of olePatron which is of type OlePatronDocument
108      * @return olePatron(OlePatronDocument)
109      */
110     public OlePatronDocument getOlePatron() {
111         return olePatron;
112     }
113     /**
114      * Sets the value for olePatron which is of type OlePatronDocument
115      * @param olePatron(OlePatronDocument)
116      */
117     public void setOlePatron(OlePatronDocument olePatron) {
118         this.olePatron = olePatron;
119     }
120     protected LinkedHashMap toStringMapper() {
121         LinkedHashMap toStringMap = new LinkedHashMap();
122         toStringMap.put("patronNoteId", patronNoteId);
123         return toStringMap;
124     }
125     /**
126      * This method converts the PersistableBusinessObjectBase OlePatronNotes into immutable object OlePatronNotesDefinition
127      * @param bo
128      * @return OlePatronNotesDefinition
129      */
130     public static OlePatronNotesDefinition to(OlePatronNotes bo) {
131         if (bo == null) { return null; }
132         return OlePatronNotesDefinition.Builder.create(bo).build();
133     }
134     /**
135      * This method converts the immutable object OlePatronNotesDefinition into PersistableBusinessObjectBase OlePatronNotes
136      * @param im
137      * @return bo
138      */
139     public static OlePatronNotes from(OlePatronNotesDefinition im) {
140         if (im == null) { return null; }
141 
142         OlePatronNotes bo = new OlePatronNotes();
143         bo.patronNoteId = im.getPatronNoteId();
144         bo.olePatronId = im.getOlePatronId();
145         //bo.olePatron = OlePatronDocument.from(im.getOlePatron());
146         bo.olePatronNoteType = OlePatronNoteType.from(im.getOlePatronNoteType());
147         bo.patronNoteTypeId = im.getOlePatronNoteType().getPatronNoteTypeId();
148         bo.patronNoteText = im.getPatronNoteText();
149 
150         return bo;
151     }
152     /**
153      * Gets the value of patronNoteId property
154      * @return patronNoteId
155      */
156     @Override
157     public String getId() {
158         return this.getPatronNoteId();
159     }
160 
161 }