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   * Created by IntelliJ IDEA.
11   * User: Gopalp
12   * Date: 5/11/12
13   * Time: 10:11 AM
14   * To change this template use File | Settings | File Templates.
15   */
16  public class OlePatronNotes extends PersistableBusinessObjectBase implements OlePatronNotesContract {
17  
18      private String patronNoteId;
19      private String olePatronId;
20      private String patronNoteTypeId;
21      private String patronNoteText;
22      private boolean active;
23      private OlePatronNoteType olePatronNoteType;
24      private OlePatronDocument olePatron;
25  
26      public String getPatronNoteId() {
27          return patronNoteId;
28      }
29  
30      public void setPatronNoteId(String patronNoteId) {
31          this.patronNoteId = patronNoteId;
32      }
33  
34      public String getOlePatronId() {
35          return olePatronId;
36      }
37  
38      public void setOlePatronId(String olePatronId) {
39          this.olePatronId = olePatronId;
40      }
41  
42      public String getPatronNoteTypeId() {
43          return patronNoteTypeId;
44      }
45  
46      public void setPatronNoteTypeId(String patronNoteTypeId) {
47          this.patronNoteTypeId = patronNoteTypeId;
48      }
49  
50      public String getPatronNoteText() {
51          return patronNoteText;
52      }
53  
54      public void setPatronNoteText(String patronNoteText) {
55          this.patronNoteText = patronNoteText;
56      }
57  
58      public boolean isActive() {
59          return active;
60      }
61  
62      public void setActive(boolean active) {
63          this.active = active;
64      }
65  
66      public OlePatronNoteType getOlePatronNoteType() {
67          return olePatronNoteType;
68      }
69  
70      public void setOlePatronNoteType(OlePatronNoteType olePatronNoteType) {
71          this.olePatronNoteType = olePatronNoteType;
72      }
73  
74      public OlePatronDocument getOlePatron() {
75          return olePatron;
76      }
77  
78      public void setOlePatron(OlePatronDocument olePatron) {
79          this.olePatron = olePatron;
80      }
81      protected LinkedHashMap toStringMapper() {
82          LinkedHashMap toStringMap = new LinkedHashMap();
83          toStringMap.put("patronNoteId", patronNoteId);
84          return toStringMap;
85      }
86  
87      public static OlePatronNotesDefinition to(OlePatronNotes bo) {
88          if (bo == null) { return null; }
89          return OlePatronNotesDefinition.Builder.create(bo).build();
90      }
91  
92      public static OlePatronNotes from(OlePatronNotesDefinition im) {
93          if (im == null) { return null; }
94  
95          OlePatronNotes bo = new OlePatronNotes();
96          bo.patronNoteId = im.getPatronNoteId();
97          bo.olePatronId = im.getOlePatronId();
98          //bo.olePatron = OlePatronDocument.from(im.getOlePatron());
99          bo.olePatronNoteType = OlePatronNoteType.from(im.getOlePatronNoteType());
100         bo.patronNoteTypeId = im.getOlePatronNoteType().getPatronNoteTypeId();
101         bo.patronNoteText = im.getPatronNoteText();
102 
103         return bo;
104     }
105 
106     @Override
107     public String getId() {
108         return this.getPatronNoteId();
109     }
110 
111 }