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