1 | |
package org.kuali.rice.kim.api.identity.personal; |
2 | |
|
3 | |
import org.apache.commons.lang.StringUtils; |
4 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
5 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
6 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
7 | |
import org.kuali.rice.core.api.CoreConstants; |
8 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
9 | |
import org.kuali.rice.core.api.mo.ModelObjectComplete; |
10 | |
import org.kuali.rice.kim.util.KimConstants; |
11 | |
import org.w3c.dom.Element; |
12 | |
|
13 | |
import javax.xml.bind.annotation.XmlAccessType; |
14 | |
import javax.xml.bind.annotation.XmlAccessorType; |
15 | |
import javax.xml.bind.annotation.XmlAnyElement; |
16 | |
import javax.xml.bind.annotation.XmlElement; |
17 | |
import javax.xml.bind.annotation.XmlRootElement; |
18 | |
import javax.xml.bind.annotation.XmlType; |
19 | |
import java.io.Serializable; |
20 | |
import java.text.ParseException; |
21 | |
import java.text.SimpleDateFormat; |
22 | |
import java.util.Collection; |
23 | |
import java.util.Date; |
24 | |
|
25 | |
@XmlRootElement(name = EntityBioDemographics.Constants.ROOT_ELEMENT_NAME) |
26 | |
@XmlAccessorType(XmlAccessType.NONE) |
27 | |
@XmlType(name = EntityBioDemographics.Constants.TYPE_NAME, propOrder = { |
28 | |
EntityBioDemographics.Elements.ENTITY_ID, |
29 | |
EntityBioDemographics.Elements.DECEASED_DATE, |
30 | |
EntityBioDemographics.Elements.BIRTH_DATE, |
31 | |
EntityBioDemographics.Elements.GENDER_CODE, |
32 | |
EntityBioDemographics.Elements.MARITAL_STATUS_CODE, |
33 | |
EntityBioDemographics.Elements.PRIMARY_LANGUAGE_CODE, |
34 | |
EntityBioDemographics.Elements.SECONDARY_LANGUAGE_CODE, |
35 | |
EntityBioDemographics.Elements.COUNTRY_OF_BIRTH_CODE, |
36 | |
EntityBioDemographics.Elements.BIRTH_STATE_CODE, |
37 | |
EntityBioDemographics.Elements.CITY_OF_BIRTH, |
38 | |
EntityBioDemographics.Elements.GEOGRAPHIC_ORIGIN, |
39 | |
EntityBioDemographics.Elements.BIRTH_DATE_UNMASKED, |
40 | |
EntityBioDemographics.Elements.GENDER_CODE_UNMASKED, |
41 | |
EntityBioDemographics.Elements.MARITAL_STATUS_CODE_UNMASKED, |
42 | |
EntityBioDemographics.Elements.PRIMARY_LANGUAGE_CODE_UNMASKED, |
43 | |
EntityBioDemographics.Elements.SECONDARY_LANGUAGE_CODE_UNMASKED, |
44 | |
EntityBioDemographics.Elements.COUNTRY_OF_BIRTH_CODE_UNMASKED, |
45 | |
EntityBioDemographics.Elements.BIRTH_STATE_CODE_UNMASKED, |
46 | |
EntityBioDemographics.Elements.CITY_OF_BIRTH_UNMASKED, |
47 | |
EntityBioDemographics.Elements.GEOGRAPHIC_ORIGIN_UNMASKED, |
48 | |
EntityBioDemographics.Elements.SUPPRESS_PERSONAL, |
49 | |
CoreConstants.CommonElements.VERSION_NUMBER, |
50 | |
CoreConstants.CommonElements.OBJECT_ID, |
51 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
52 | |
}) |
53 | 6 | public final class EntityBioDemographics |
54 | |
implements ModelObjectComplete, EntityBioDemographicsContract |
55 | |
{ |
56 | |
|
57 | |
@XmlElement(name = Elements.ENTITY_ID, required = false) |
58 | |
private final String entityId; |
59 | |
@XmlElement(name = Elements.DECEASED_DATE, required = false) |
60 | |
private final String deceasedDate; |
61 | |
@XmlElement(name = Elements.BIRTH_DATE, required = false) |
62 | |
private final String birthDate; |
63 | |
@XmlElement(name = Elements.GENDER_CODE, required = false) |
64 | |
private final String genderCode; |
65 | |
@XmlElement(name = Elements.MARITAL_STATUS_CODE, required = false) |
66 | |
private final String maritalStatusCode; |
67 | |
@XmlElement(name = Elements.PRIMARY_LANGUAGE_CODE, required = false) |
68 | |
private final String primaryLanguageCode; |
69 | |
@XmlElement(name = Elements.SECONDARY_LANGUAGE_CODE, required = false) |
70 | |
private final String secondaryLanguageCode; |
71 | |
@XmlElement(name = Elements.COUNTRY_OF_BIRTH_CODE, required = false) |
72 | |
private final String countryOfBirthCode; |
73 | |
@XmlElement(name = Elements.BIRTH_STATE_CODE, required = false) |
74 | |
private final String birthStateCode; |
75 | |
@XmlElement(name = Elements.CITY_OF_BIRTH, required = false) |
76 | |
private final String cityOfBirth; |
77 | |
@XmlElement(name = Elements.GEOGRAPHIC_ORIGIN, required = false) |
78 | |
private final String geographicOrigin; |
79 | |
@XmlElement(name = Elements.BIRTH_DATE_UNMASKED, required = false) |
80 | |
private final String birthDateUnmasked; |
81 | |
@XmlElement(name = Elements.GENDER_CODE_UNMASKED, required = false) |
82 | |
private final String genderCodeUnmasked; |
83 | |
@XmlElement(name = Elements.MARITAL_STATUS_CODE_UNMASKED, required = false) |
84 | |
private final String maritalStatusCodeUnmasked; |
85 | |
@XmlElement(name = Elements.PRIMARY_LANGUAGE_CODE_UNMASKED, required = false) |
86 | |
private final String primaryLanguageCodeUnmasked; |
87 | |
@XmlElement(name = Elements.SECONDARY_LANGUAGE_CODE_UNMASKED, required = false) |
88 | |
private final String secondaryLanguageCodeUnmasked; |
89 | |
@XmlElement(name = Elements.COUNTRY_OF_BIRTH_CODE_UNMASKED, required = false) |
90 | |
private final String countryOfBirthCodeUnmasked; |
91 | |
@XmlElement(name = Elements.BIRTH_STATE_CODE_UNMASKED, required = false) |
92 | |
private final String birthStateCodeUnmasked; |
93 | |
@XmlElement(name = Elements.CITY_OF_BIRTH_UNMASKED, required = false) |
94 | |
private final String cityOfBirthUnmasked; |
95 | |
@XmlElement(name = Elements.GEOGRAPHIC_ORIGIN_UNMASKED, required = false) |
96 | |
private final String geographicOriginUnmasked; |
97 | |
@XmlElement(name = Elements.SUPPRESS_PERSONAL, required = false) |
98 | |
private final boolean suppressPersonal; |
99 | |
@XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false) |
100 | |
private final Long versionNumber; |
101 | |
@XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false) |
102 | |
private final String objectId; |
103 | 10 | @SuppressWarnings("unused") |
104 | |
@XmlAnyElement |
105 | |
private final Collection<Element> _futureElements = null; |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | 4 | private EntityBioDemographics() { |
112 | 4 | this.entityId = null; |
113 | 4 | this.deceasedDate = null; |
114 | 4 | this.birthDate = null; |
115 | 4 | this.genderCode = null; |
116 | 4 | this.maritalStatusCode = null; |
117 | 4 | this.primaryLanguageCode = null; |
118 | 4 | this.secondaryLanguageCode = null; |
119 | 4 | this.countryOfBirthCode = null; |
120 | 4 | this.birthStateCode = null; |
121 | 4 | this.cityOfBirth = null; |
122 | 4 | this.geographicOrigin = null; |
123 | 4 | this.birthDateUnmasked = null; |
124 | 4 | this.genderCodeUnmasked = null; |
125 | 4 | this.maritalStatusCodeUnmasked = null; |
126 | 4 | this.primaryLanguageCodeUnmasked = null; |
127 | 4 | this.secondaryLanguageCodeUnmasked = null; |
128 | 4 | this.countryOfBirthCodeUnmasked = null; |
129 | 4 | this.birthStateCodeUnmasked = null; |
130 | 4 | this.cityOfBirthUnmasked = null; |
131 | 4 | this.geographicOriginUnmasked = null; |
132 | 4 | this.suppressPersonal = false; |
133 | 4 | this.versionNumber = null; |
134 | 4 | this.objectId = null; |
135 | 4 | } |
136 | |
|
137 | 6 | private EntityBioDemographics(Builder builder) { |
138 | 6 | this.entityId = builder.getEntityId(); |
139 | 6 | this.deceasedDate = builder.getDeceasedDate(); |
140 | 6 | this.birthDate = builder.getBirthDate(); |
141 | 6 | this.genderCode = builder.getGenderCode(); |
142 | 6 | this.maritalStatusCode = builder.getMaritalStatusCode(); |
143 | 6 | this.primaryLanguageCode = builder.getPrimaryLanguageCode(); |
144 | 6 | this.secondaryLanguageCode = builder.getSecondaryLanguageCode(); |
145 | 6 | this.countryOfBirthCode = builder.getCountryOfBirthCode(); |
146 | 6 | this.birthStateCode = builder.getBirthStateCode(); |
147 | 6 | this.cityOfBirth = builder.getCityOfBirth(); |
148 | 6 | this.geographicOrigin = builder.getGeographicOrigin(); |
149 | 6 | this.birthDateUnmasked = builder.getBirthDateUnmasked(); |
150 | 6 | this.genderCodeUnmasked = builder.getGenderCodeUnmasked(); |
151 | 6 | this.maritalStatusCodeUnmasked = builder.getMaritalStatusCodeUnmasked(); |
152 | 6 | this.primaryLanguageCodeUnmasked = builder.getPrimaryLanguageCodeUnmasked(); |
153 | 6 | this.secondaryLanguageCodeUnmasked = builder.getSecondaryLanguageCodeUnmasked(); |
154 | 6 | this.countryOfBirthCodeUnmasked = builder.getCountryOfBirthCodeUnmasked(); |
155 | 6 | this.birthStateCodeUnmasked = builder.getBirthStateCodeUnmasked(); |
156 | 6 | this.cityOfBirthUnmasked = builder.getCityOfBirthUnmasked(); |
157 | 6 | this.geographicOriginUnmasked = builder.getGeographicOriginUnmasked(); |
158 | 6 | this.suppressPersonal = builder.isSuppressPersonal(); |
159 | 6 | this.versionNumber = builder.getVersionNumber(); |
160 | 6 | this.objectId = builder.getObjectId(); |
161 | 6 | } |
162 | |
|
163 | |
@Override |
164 | |
public String getEntityId() { |
165 | 4 | return this.entityId; |
166 | |
} |
167 | |
|
168 | |
@Override |
169 | |
public String getDeceasedDate() { |
170 | 4 | return this.deceasedDate; |
171 | |
} |
172 | |
|
173 | |
@Override |
174 | |
public String getBirthDate() { |
175 | 4 | return this.birthDate; |
176 | |
} |
177 | |
|
178 | |
@Override |
179 | |
public String getGenderCode() { |
180 | 4 | return this.genderCode; |
181 | |
} |
182 | |
|
183 | |
@Override |
184 | |
public String getMaritalStatusCode() { |
185 | 4 | return this.maritalStatusCode; |
186 | |
} |
187 | |
|
188 | |
@Override |
189 | |
public String getPrimaryLanguageCode() { |
190 | 4 | return this.primaryLanguageCode; |
191 | |
} |
192 | |
|
193 | |
@Override |
194 | |
public String getSecondaryLanguageCode() { |
195 | 4 | return this.secondaryLanguageCode; |
196 | |
} |
197 | |
|
198 | |
@Override |
199 | |
public String getCountryOfBirthCode() { |
200 | 4 | return this.countryOfBirthCode; |
201 | |
} |
202 | |
|
203 | |
@Override |
204 | |
public String getBirthStateCode() { |
205 | 4 | return this.birthStateCode; |
206 | |
} |
207 | |
|
208 | |
@Override |
209 | |
public String getCityOfBirth() { |
210 | 4 | return this.cityOfBirth; |
211 | |
} |
212 | |
|
213 | |
@Override |
214 | |
public String getGeographicOrigin() { |
215 | 4 | return this.geographicOrigin; |
216 | |
} |
217 | |
|
218 | |
@Override |
219 | |
public String getBirthDateUnmasked() { |
220 | 1 | return this.birthDateUnmasked; |
221 | |
} |
222 | |
|
223 | |
@Override |
224 | |
public String getGenderCodeUnmasked() { |
225 | 1 | return this.genderCodeUnmasked; |
226 | |
} |
227 | |
|
228 | |
@Override |
229 | |
public String getMaritalStatusCodeUnmasked() { |
230 | 1 | return this.maritalStatusCodeUnmasked; |
231 | |
} |
232 | |
|
233 | |
@Override |
234 | |
public String getPrimaryLanguageCodeUnmasked() { |
235 | 1 | return this.primaryLanguageCodeUnmasked; |
236 | |
} |
237 | |
|
238 | |
@Override |
239 | |
public String getSecondaryLanguageCodeUnmasked() { |
240 | 1 | return this.secondaryLanguageCodeUnmasked; |
241 | |
} |
242 | |
|
243 | |
@Override |
244 | |
public String getCountryOfBirthCodeUnmasked() { |
245 | 1 | return this.countryOfBirthCodeUnmasked; |
246 | |
} |
247 | |
|
248 | |
@Override |
249 | |
public String getBirthStateCodeUnmasked() { |
250 | 1 | return this.birthStateCodeUnmasked; |
251 | |
} |
252 | |
|
253 | |
@Override |
254 | |
public String getCityOfBirthUnmasked() { |
255 | 1 | return this.cityOfBirthUnmasked; |
256 | |
} |
257 | |
|
258 | |
@Override |
259 | |
public String getGeographicOriginUnmasked() { |
260 | 1 | return this.geographicOriginUnmasked; |
261 | |
} |
262 | |
|
263 | |
@Override |
264 | |
public boolean isSuppressPersonal() { |
265 | 4 | return this.suppressPersonal; |
266 | |
} |
267 | |
|
268 | |
@Override |
269 | |
public Long getVersionNumber() { |
270 | 4 | return this.versionNumber; |
271 | |
} |
272 | |
|
273 | |
@Override |
274 | |
public String getObjectId() { |
275 | 4 | return this.objectId; |
276 | |
} |
277 | |
|
278 | |
@Override |
279 | |
public int hashCode() { |
280 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
281 | |
} |
282 | |
|
283 | |
@Override |
284 | |
public boolean equals(Object object) { |
285 | 5 | return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
286 | |
} |
287 | |
|
288 | |
@Override |
289 | |
public String toString() { |
290 | 0 | return ToStringBuilder.reflectionToString(this); |
291 | |
} |
292 | |
|
293 | |
|
294 | |
|
295 | |
|
296 | |
|
297 | |
|
298 | 4 | public final static class Builder |
299 | |
implements Serializable, ModelBuilder, EntityBioDemographicsContract |
300 | |
{ |
301 | |
|
302 | |
private String entityId; |
303 | |
private String deceasedDate; |
304 | |
private String birthDate; |
305 | |
private String genderCode; |
306 | |
private String maritalStatusCode; |
307 | |
private String primaryLanguageCode; |
308 | |
private String secondaryLanguageCode; |
309 | |
private String countryOfBirthCode; |
310 | |
private String birthStateCode; |
311 | |
private String cityOfBirth; |
312 | |
private String geographicOrigin; |
313 | |
private boolean suppressPersonal; |
314 | |
private Long versionNumber; |
315 | |
private String objectId; |
316 | |
|
317 | 11 | private Builder(String entityId, String genderCode) { |
318 | 11 | setEntityId(entityId); |
319 | 9 | setGenderCode(genderCode); |
320 | 7 | } |
321 | |
|
322 | |
public static Builder create(String entityId, String genderCode) { |
323 | |
|
324 | 11 | return new Builder(entityId, genderCode); |
325 | |
} |
326 | |
|
327 | |
public static Builder create(EntityBioDemographicsContract contract) { |
328 | 5 | if (contract == null) { |
329 | 0 | throw new IllegalArgumentException("contract was null"); |
330 | |
} |
331 | 5 | Builder builder = create(contract.getEntityId(), contract.getGenderCode()); |
332 | 5 | builder.setDeceasedDate(contract.getDeceasedDate()); |
333 | 5 | builder.setBirthDate(contract.getBirthDate()); |
334 | 5 | builder.setMaritalStatusCode(contract.getMaritalStatusCode()); |
335 | 5 | builder.setPrimaryLanguageCode(contract.getPrimaryLanguageCode()); |
336 | 5 | builder.setSecondaryLanguageCode(contract.getSecondaryLanguageCode()); |
337 | 5 | builder.setCountryOfBirthCode(contract.getCountryOfBirthCode()); |
338 | 5 | builder.setBirthStateCode(contract.getBirthStateCode()); |
339 | 5 | builder.setCityOfBirth(contract.getCityOfBirth()); |
340 | 5 | builder.setGeographicOrigin(contract.getGeographicOrigin()); |
341 | 5 | builder.setSuppressPersonal(contract.isSuppressPersonal()); |
342 | 5 | builder.setVersionNumber(contract.getVersionNumber()); |
343 | 5 | builder.setObjectId(contract.getObjectId()); |
344 | 5 | return builder; |
345 | |
} |
346 | |
|
347 | |
public EntityBioDemographics build() { |
348 | 6 | return new EntityBioDemographics(this); |
349 | |
} |
350 | |
|
351 | |
@Override |
352 | |
public String getEntityId() { |
353 | 6 | return this.entityId; |
354 | |
} |
355 | |
|
356 | |
@Override |
357 | |
public String getDeceasedDate() { |
358 | 6 | return this.deceasedDate; |
359 | |
} |
360 | |
|
361 | |
@Override |
362 | |
public String getBirthDate() { |
363 | 6 | if (isSuppressPersonal()) { |
364 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
365 | |
} |
366 | 6 | return this.birthDate; |
367 | |
} |
368 | |
|
369 | |
@Override |
370 | |
public String getGenderCode() { |
371 | 6 | if (isSuppressPersonal()) { |
372 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
373 | |
} |
374 | 6 | return this.genderCode; |
375 | |
} |
376 | |
|
377 | |
@Override |
378 | |
public String getMaritalStatusCode() { |
379 | 6 | if (isSuppressPersonal()) { |
380 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
381 | |
} |
382 | 6 | return this.maritalStatusCode; |
383 | |
} |
384 | |
|
385 | |
@Override |
386 | |
public String getPrimaryLanguageCode() { |
387 | 6 | if (isSuppressPersonal()) { |
388 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
389 | |
} |
390 | 6 | return this.primaryLanguageCode; |
391 | |
} |
392 | |
|
393 | |
@Override |
394 | |
public String getSecondaryLanguageCode() { |
395 | 6 | if (isSuppressPersonal()) { |
396 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
397 | |
} |
398 | 6 | return this.secondaryLanguageCode; |
399 | |
} |
400 | |
|
401 | |
@Override |
402 | |
public String getCountryOfBirthCode() { |
403 | 6 | if (isSuppressPersonal()) { |
404 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
405 | |
} |
406 | 6 | return this.countryOfBirthCode; |
407 | |
} |
408 | |
|
409 | |
@Override |
410 | |
public String getBirthStateCode() { |
411 | 6 | if (isSuppressPersonal()) { |
412 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
413 | |
} |
414 | 6 | return this.birthStateCode; |
415 | |
} |
416 | |
|
417 | |
@Override |
418 | |
public String getCityOfBirth() { |
419 | 6 | if (isSuppressPersonal()) { |
420 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
421 | |
} |
422 | 6 | return this.cityOfBirth; |
423 | |
} |
424 | |
|
425 | |
@Override |
426 | |
public String getGeographicOrigin() { |
427 | 6 | if (isSuppressPersonal()) { |
428 | 0 | return KimConstants.RESTRICTED_DATA_MASK; |
429 | |
} |
430 | 6 | return this.geographicOrigin; |
431 | |
} |
432 | |
|
433 | |
@Override |
434 | |
public String getBirthDateUnmasked() { |
435 | 6 | return this.birthDate; |
436 | |
} |
437 | |
|
438 | |
@Override |
439 | |
public String getGenderCodeUnmasked() { |
440 | 6 | return this.genderCode; |
441 | |
} |
442 | |
|
443 | |
@Override |
444 | |
public String getMaritalStatusCodeUnmasked() { |
445 | 6 | return this.maritalStatusCode; |
446 | |
} |
447 | |
|
448 | |
@Override |
449 | |
public String getPrimaryLanguageCodeUnmasked() { |
450 | 6 | return this.primaryLanguageCode; |
451 | |
} |
452 | |
|
453 | |
@Override |
454 | |
public String getSecondaryLanguageCodeUnmasked() { |
455 | 6 | return this.secondaryLanguageCode; |
456 | |
} |
457 | |
|
458 | |
@Override |
459 | |
public String getCountryOfBirthCodeUnmasked() { |
460 | 6 | return this.countryOfBirthCode; |
461 | |
} |
462 | |
|
463 | |
@Override |
464 | |
public String getBirthStateCodeUnmasked() { |
465 | 6 | return this.birthStateCode; |
466 | |
} |
467 | |
|
468 | |
@Override |
469 | |
public String getCityOfBirthUnmasked() { |
470 | 6 | return this.cityOfBirth; |
471 | |
} |
472 | |
|
473 | |
@Override |
474 | |
public String getGeographicOriginUnmasked() { |
475 | 6 | return this.geographicOrigin; |
476 | |
} |
477 | |
|
478 | |
@Override |
479 | |
public boolean isSuppressPersonal() { |
480 | 60 | return this.suppressPersonal; |
481 | |
} |
482 | |
|
483 | |
@Override |
484 | |
public Long getVersionNumber() { |
485 | 6 | return this.versionNumber; |
486 | |
} |
487 | |
|
488 | |
@Override |
489 | |
public String getObjectId() { |
490 | 6 | return this.objectId; |
491 | |
} |
492 | |
|
493 | |
public void setEntityId(String entityId) { |
494 | 11 | if (StringUtils.isEmpty(entityId)) { |
495 | 2 | throw new IllegalArgumentException("id is empty"); |
496 | |
} |
497 | 9 | this.entityId = entityId; |
498 | 9 | } |
499 | |
|
500 | |
public void setDeceasedDate(String deceasedDate) { |
501 | 5 | if (deceasedDate != null) { |
502 | 4 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
503 | |
try{ |
504 | 4 | format.parse(deceasedDate); |
505 | 4 | this.deceasedDate = deceasedDate; |
506 | |
} |
507 | 0 | catch(ParseException e) { |
508 | 0 | throw new IllegalArgumentException("deceasedDate is not of the format 'yyyy-MM-DD'"); |
509 | 4 | } |
510 | |
} |
511 | 5 | } |
512 | |
|
513 | |
public void setBirthDate(String birthDate) { |
514 | 5 | if (birthDate != null) { |
515 | 4 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
516 | |
try{ |
517 | 4 | format.parse(birthDate); |
518 | 4 | this.birthDate = birthDate; |
519 | |
} |
520 | 0 | catch(ParseException e) { |
521 | 0 | throw new IllegalArgumentException("birthDate is not of the format 'yyyy-MM-DD'"); |
522 | 4 | } |
523 | |
} |
524 | 5 | } |
525 | |
|
526 | |
public void setDeceasedDate(Date deceasedDate) { |
527 | 0 | this.deceasedDate = new SimpleDateFormat("yyyy-MM-dd").format(deceasedDate); |
528 | 0 | } |
529 | |
|
530 | |
public void setBirthDate(Date birthDate) { |
531 | 0 | this.birthDate = new SimpleDateFormat("yyyy-MM-dd").format(birthDate); |
532 | 0 | } |
533 | |
|
534 | |
public void setGenderCode(String genderCode) { |
535 | 9 | if (StringUtils.isEmpty(genderCode)) { |
536 | 2 | throw new IllegalArgumentException("genderCode is empty"); |
537 | |
} |
538 | 7 | this.genderCode = genderCode; |
539 | 7 | } |
540 | |
|
541 | |
public void setMaritalStatusCode(String maritalStatusCode) { |
542 | 5 | this.maritalStatusCode = maritalStatusCode; |
543 | 5 | } |
544 | |
|
545 | |
public void setPrimaryLanguageCode(String primaryLanguageCode) { |
546 | 5 | this.primaryLanguageCode = primaryLanguageCode; |
547 | 5 | } |
548 | |
|
549 | |
public void setSecondaryLanguageCode(String secondaryLanguageCode) { |
550 | 5 | this.secondaryLanguageCode = secondaryLanguageCode; |
551 | 5 | } |
552 | |
|
553 | |
public void setCountryOfBirthCode(String countryOfBirthCode) { |
554 | 5 | this.countryOfBirthCode = countryOfBirthCode; |
555 | 5 | } |
556 | |
|
557 | |
public void setBirthStateCode(String birthStateCode) { |
558 | 5 | this.birthStateCode = birthStateCode; |
559 | 5 | } |
560 | |
|
561 | |
public void setCityOfBirth(String cityOfBirth) { |
562 | 5 | this.cityOfBirth = cityOfBirth; |
563 | 5 | } |
564 | |
|
565 | |
public void setGeographicOrigin(String geographicOrigin) { |
566 | 5 | this.geographicOrigin = geographicOrigin; |
567 | 5 | } |
568 | |
|
569 | |
private void setSuppressPersonal(boolean suppressPersonal) { |
570 | 5 | this.suppressPersonal = suppressPersonal; |
571 | 5 | } |
572 | |
|
573 | |
public void setVersionNumber(Long versionNumber) { |
574 | 5 | this.versionNumber = versionNumber; |
575 | 5 | } |
576 | |
|
577 | |
public void setObjectId(String objectId) { |
578 | 5 | this.objectId = objectId; |
579 | 5 | } |
580 | |
|
581 | |
} |
582 | |
|
583 | |
|
584 | |
|
585 | |
|
586 | |
|
587 | |
|
588 | 0 | static class Constants { |
589 | |
|
590 | |
final static String ROOT_ELEMENT_NAME = "entityBioDemographics"; |
591 | |
final static String TYPE_NAME = "EntityBioDemographicsType"; |
592 | 1 | final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; |
593 | |
|
594 | |
} |
595 | |
|
596 | |
|
597 | |
|
598 | |
|
599 | |
|
600 | |
|
601 | 0 | static class Elements { |
602 | |
|
603 | |
final static String ENTITY_ID = "entityId"; |
604 | |
final static String DECEASED_DATE = "deceasedDate"; |
605 | |
final static String BIRTH_DATE = "birthDate"; |
606 | |
final static String GENDER_CODE = "genderCode"; |
607 | |
final static String MARITAL_STATUS_CODE = "maritalStatusCode"; |
608 | |
final static String PRIMARY_LANGUAGE_CODE = "primaryLanguageCode"; |
609 | |
final static String SECONDARY_LANGUAGE_CODE = "secondaryLanguageCode"; |
610 | |
final static String COUNTRY_OF_BIRTH_CODE = "countryOfBirthCode"; |
611 | |
final static String BIRTH_STATE_CODE = "birthStateCode"; |
612 | |
final static String CITY_OF_BIRTH = "cityOfBirth"; |
613 | |
final static String GEOGRAPHIC_ORIGIN = "geographicOrigin"; |
614 | |
final static String BIRTH_DATE_UNMASKED = "birthDateUnmasked"; |
615 | |
final static String GENDER_CODE_UNMASKED = "genderCodeUnmasked"; |
616 | |
final static String MARITAL_STATUS_CODE_UNMASKED = "maritalStatusCodeUnmasked"; |
617 | |
final static String PRIMARY_LANGUAGE_CODE_UNMASKED = "primaryLanguageCodeUnmasked"; |
618 | |
final static String SECONDARY_LANGUAGE_CODE_UNMASKED = "secondaryLanguageCodeUnmasked"; |
619 | |
final static String COUNTRY_OF_BIRTH_CODE_UNMASKED = "countryOfBirthCodeUnmasked"; |
620 | |
final static String BIRTH_STATE_CODE_UNMASKED = "birthStateCodeUnmasked"; |
621 | |
final static String CITY_OF_BIRTH_UNMASKED = "cityOfBirthUnmasked"; |
622 | |
final static String GEOGRAPHIC_ORIGIN_UNMASKED = "geographicOriginUnmasked"; |
623 | |
final static String SUPPRESS_PERSONAL = "suppressPersonal"; |
624 | |
|
625 | |
} |
626 | |
|
627 | |
} |