1 package org.kuali.ole.deliver.bo;
2
3 import org.apache.commons.collections.CollectionUtils;
4 import org.apache.commons.lang3.StringUtils;
5 import org.kuali.ole.deliver.api.OlePatronLostBarcodeContract;
6 import org.kuali.ole.deliver.api.OlePatronLostBarcodeDefinition;
7 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
8 import org.kuali.rice.krad.service.KRADServiceLocator;
9
10 import java.sql.Date;
11 import java.util.HashMap;
12 import java.util.Map;
13
14
15
16
17 public class OlePatronLostBarcode extends PersistableBusinessObjectBase implements OlePatronLostBarcodeContract {
18
19 private String olePatronLostBarcodeId;
20 private String olePatronId;
21 private Date invalidOrLostBarcodeEffDate;
22 private String invalidOrLostBarcodeNumber;
23 private OlePatronDocument olePatronDocument;
24 private boolean revertBarcode;
25 private String status;
26 private String description;
27 private boolean active;
28 public String getOlePatronLostBarcodeId() {
29 return olePatronLostBarcodeId;
30 }
31
32 public void setOlePatronLostBarcodeId(String olePatronLostBarcodeId) {
33 this.olePatronLostBarcodeId = olePatronLostBarcodeId;
34 }
35
36 public String getOlePatronId() {
37 return olePatronId;
38 }
39
40 public void setOlePatronId(String olePatronId) {
41 this.olePatronId = olePatronId;
42 }
43
44 public Date getInvalidOrLostBarcodeEffDate() {
45 return invalidOrLostBarcodeEffDate;
46 }
47
48 public void setInvalidOrLostBarcodeEffDate(Date invalidOrLostBarcodeEffDate) {
49 this.invalidOrLostBarcodeEffDate = invalidOrLostBarcodeEffDate;
50 }
51
52 public String getInvalidOrLostBarcodeNumber() {
53 return invalidOrLostBarcodeNumber;
54 }
55
56 public void setInvalidOrLostBarcodeNumber(String invalidOrLostBarcodeNumber) {
57 this.invalidOrLostBarcodeNumber = invalidOrLostBarcodeNumber;
58 }
59
60 public OlePatronDocument getOlePatronDocument() {
61 if (null == olePatronDocument) {
62 String patronId = getOlePatronId();
63 if (StringUtils.isNotEmpty(patronId)) {
64 Map<String, String> parameterMap = new HashMap<>();
65 parameterMap.put("olePatronId", patronId);
66 olePatronDocument = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OlePatronDocument.class, parameterMap);
67 }
68 }
69 return olePatronDocument;
70 }
71
72 public void setOlePatronDocument(OlePatronDocument olePatronDocument) {
73 this.olePatronDocument = olePatronDocument;
74 }
75
76
77
78
79
80
81
82 public static OlePatronLostBarcodeDefinition to(org.kuali.ole.deliver.bo.OlePatronLostBarcode bo) {
83 if (bo == null) {
84 return null;
85 }
86 return OlePatronLostBarcodeDefinition.Builder.create(bo).build();
87 }
88
89
90
91
92
93
94
95 public static org.kuali.ole.deliver.bo.OlePatronLostBarcode from(OlePatronLostBarcodeDefinition im) {
96 if (im == null) {
97 return null;
98 }
99
100 org.kuali.ole.deliver.bo.OlePatronLostBarcode bo = new org.kuali.ole.deliver.bo.OlePatronLostBarcode();
101 bo.olePatronLostBarcodeId = im.getOlePatronLostBarcodeId();
102 bo.olePatronId = im.getOlePatronId();
103
104 bo.invalidOrLostBarcodeEffDate = im.getInvalidOrLostBarcodeEffDate();
105 bo.invalidOrLostBarcodeNumber = im.getInvalidOrLostBarcodeNumber();
106 bo.versionNumber = im.getVersionNumber();
107
108 return bo;
109 }
110
111 public boolean isRevertBarcode() {
112 return revertBarcode;
113 }
114
115 public void setRevertBarcode(boolean revertBarcode) {
116 this.revertBarcode = revertBarcode;
117 }
118
119 @Override
120 public String getId() {
121 return this.olePatronLostBarcodeId;
122 }
123
124 public String getStatus() {
125 return status;
126 }
127
128 public void setStatus(String status) {
129 this.status = status;
130 }
131
132 public String getDescription() {
133 return description;
134 }
135
136 public void setDescription(String description) {
137 this.description = description;
138 }
139
140 public boolean isActive() {
141 return active;
142 }
143
144 public void setActive(boolean active) {
145 this.active = active;
146 }
147 }