1 package org.kuali.ole.deliver.bo;
2
3 import org.kuali.ole.deliver.api.OleAddressContract;
4 import org.kuali.ole.deliver.api.OleAddressDefinition;
5 import org.kuali.rice.kim.impl.identity.address.EntityAddressBo;
6 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
7
8 import java.util.Date;
9
10
11
12
13 public class OleAddressBo extends PersistableBusinessObjectBase implements OleAddressContract {
14
15 private String oleAddressId;
16 private String olePatronId;
17 private String id;
18 private boolean addressVerified;
19 private Date addressValidFrom;
20 private Date addressValidTo;
21 private String addressSource;
22 private String oleAddressSourceName;
23 private OleAddressSourceBo addressSourceBo = new OleAddressSourceBo();
24 private EntityAddressBo entityAddress;
25 private OlePatronDocument olePatronDocument;
26 private boolean deliverAddress;
27
28 public OleAddressBo() {
29 this.setAddressVerified(true);
30 }
31
32
33
34
35
36
37 public OlePatronDocument getOlePatronDocument() {
38 return olePatronDocument;
39 }
40
41
42
43
44
45
46 public void setOlePatronDocument(OlePatronDocument olePatronDocument) {
47 this.olePatronDocument = olePatronDocument;
48 }
49
50
51
52
53
54
55 public String getOleAddressId() {
56 return oleAddressId;
57 }
58
59
60
61
62
63
64 public void setOleAddressId(String oleAddressId) {
65 this.oleAddressId = oleAddressId;
66 }
67
68
69
70
71
72
73 public boolean isAddressVerified() {
74 return addressVerified;
75 }
76
77
78
79
80
81
82 public void setAddressVerified(boolean addressVerified) {
83 this.addressVerified = addressVerified;
84 }
85
86
87
88
89
90
91 public String getOlePatronId() {
92 return olePatronId;
93 }
94
95
96
97
98
99
100 public void setOlePatronId(String olePatronId) {
101 this.olePatronId = olePatronId;
102 }
103
104
105
106
107
108
109 public Date getAddressValidFrom() {
110 return addressValidFrom;
111 }
112
113
114
115
116
117
118 public void setAddressValidFrom(Date addressValidFrom) {
119 this.addressValidFrom = addressValidFrom;
120 }
121
122
123
124
125
126
127 public Date getAddressValidTo() {
128 return addressValidTo;
129 }
130
131
132
133
134
135
136 public void setAddressValidTo(Date addressValidTo) {
137 this.addressValidTo = addressValidTo;
138 }
139
140
141
142
143
144
145 public String getAddressSource() {
146 return addressSource;
147 }
148
149
150
151
152
153
154 public void setAddressSource(String addressSource) {
155 this.addressSource = addressSource;
156 }
157
158
159
160
161
162
163 public OleAddressSourceBo getAddressSourceBo() {
164 return addressSourceBo;
165 }
166
167
168
169
170
171
172 public void setAddressSourceBo(OleAddressSourceBo addressSourceBo) {
173 this.addressSourceBo = addressSourceBo;
174 }
175
176
177
178
179
180
181 public EntityAddressBo getEntityAddress() {
182 return entityAddress;
183 }
184
185
186
187
188
189
190 public void setEntityAddress(EntityAddressBo entityAddress) {
191 this.entityAddress = entityAddress;
192 }
193
194
195
196
197
198
199 public String getOleAddressSourceName() {
200 if (addressSourceBo != null) {
201 return addressSourceBo.getOleAddressSourceName();
202 }
203 return null;
204
205 }
206
207
208
209
210
211
212
213 public static OleAddressDefinition to(org.kuali.ole.deliver.bo.OleAddressBo bo) {
214 if (bo == null) {
215 return null;
216 }
217 return OleAddressDefinition.Builder.create(bo).build();
218 }
219
220
221
222
223
224
225
226 public static org.kuali.ole.deliver.bo.OleAddressBo from(OleAddressDefinition imOleAddressDefinition) {
227 if (imOleAddressDefinition == null) {
228 return null;
229 }
230
231 org.kuali.ole.deliver.bo.OleAddressBo bo = new org.kuali.ole.deliver.bo.OleAddressBo();
232 bo.oleAddressId = imOleAddressDefinition.getOleAddressId();
233 bo.olePatronId = imOleAddressDefinition.getOlePatronId();
234
235 bo.id = imOleAddressDefinition.getId();
236 bo.addressVerified = imOleAddressDefinition.isAddressVerified();
237 bo.addressValidFrom = imOleAddressDefinition.getAddressValidFrom();
238 bo.addressValidTo = imOleAddressDefinition.getAddressValidTo();
239 bo.addressSource = imOleAddressDefinition.getAddressSource();
240 bo.versionNumber = imOleAddressDefinition.getVersionNumber();
241 bo.deliverAddress = imOleAddressDefinition.isDeliverAddress();
242
243
244
245 if (imOleAddressDefinition.getAddressSourceBo() != null) {
246 bo.addressSourceBo = OleAddressSourceBo.from(imOleAddressDefinition.getAddressSourceBo());
247 }
248
249 return bo;
250 }
251
252
253
254
255
256
257 public String getId() {
258 return id;
259 }
260
261
262
263
264
265
266 public void setId(String id) {
267 this.id = id;
268 }
269
270 public boolean isDeliverAddress() {
271 return deliverAddress;
272 }
273
274 public void setDeliverAddress(boolean deliverAddress) {
275 this.deliverAddress = deliverAddress;
276 }
277 }