View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.api.identity.personal;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.apache.log4j.Logger;
20  import org.joda.time.DateTime;
21  import org.joda.time.Years;
22  import org.kuali.rice.core.api.CoreConstants;
23  import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
24  import org.kuali.rice.core.api.mo.ModelBuilder;
25  import org.kuali.rice.core.api.util.jaxb.PrimitiveBooleanDefaultToFalseAdapter;
26  import org.kuali.rice.kim.api.KimConstants;
27  import org.w3c.dom.Element;
28  
29  import javax.xml.bind.annotation.XmlAccessType;
30  import javax.xml.bind.annotation.XmlAccessorType;
31  import javax.xml.bind.annotation.XmlAnyElement;
32  import javax.xml.bind.annotation.XmlElement;
33  import javax.xml.bind.annotation.XmlRootElement;
34  import javax.xml.bind.annotation.XmlType;
35  import java.io.Serializable;
36  import java.text.ParseException;
37  import java.text.SimpleDateFormat;
38  import java.util.Collection;
39  import java.util.Date;
40  
41  @XmlRootElement(name = EntityBioDemographics.Constants.ROOT_ELEMENT_NAME)
42  @XmlAccessorType(XmlAccessType.NONE)
43  @XmlType(name = EntityBioDemographics.Constants.TYPE_NAME, propOrder = {
44      EntityBioDemographics.Elements.ENTITY_ID,
45      EntityBioDemographics.Elements.DECEASED_DATE,
46      EntityBioDemographics.Elements.BIRTH_DATE,
47      EntityBioDemographics.Elements.AGE,
48      EntityBioDemographics.Elements.GENDER_CODE,
49      EntityBioDemographics.Elements.GENDER_CHANGE_CODE,
50      EntityBioDemographics.Elements.MARITAL_STATUS_CODE,
51      EntityBioDemographics.Elements.PRIMARY_LANGUAGE_CODE,
52      EntityBioDemographics.Elements.SECONDARY_LANGUAGE_CODE,
53      EntityBioDemographics.Elements.BIRTH_COUNTRY,
54      EntityBioDemographics.Elements.BIRTH_STATE_PROVINCE_CODE,
55      EntityBioDemographics.Elements.BIRTH_CITY,
56      EntityBioDemographics.Elements.GEOGRAPHIC_ORIGIN,
57      EntityBioDemographics.Elements.BIRTH_DATE_UNMASKED,
58      EntityBioDemographics.Elements.GENDER_CODE_UNMASKED,
59      EntityBioDemographics.Elements.GENDER_CHANGE_CODE_UNMASKED,
60      EntityBioDemographics.Elements.MARITAL_STATUS_CODE_UNMASKED,
61      EntityBioDemographics.Elements.PRIMARY_LANGUAGE_CODE_UNMASKED,
62      EntityBioDemographics.Elements.SECONDARY_LANGUAGE_CODE_UNMASKED,
63      EntityBioDemographics.Elements.BIRTH_COUNTRY_UNMASKED,
64      EntityBioDemographics.Elements.BIRTH_STATE_PROVINCE_CODE_UNMASKED,
65      EntityBioDemographics.Elements.BIRTH_CITY_UNMASKED,
66      EntityBioDemographics.Elements.GEOGRAPHIC_ORIGIN_UNMASKED,
67      EntityBioDemographics.Elements.NOTE_MESSAGE,
68      EntityBioDemographics.Elements.SUPPRESS_PERSONAL,
69      CoreConstants.CommonElements.VERSION_NUMBER,
70      CoreConstants.CommonElements.OBJECT_ID,
71      CoreConstants.CommonElements.FUTURE_ELEMENTS
72  })
73  public final class EntityBioDemographics extends AbstractDataTransferObject
74      implements EntityBioDemographicsContract
75  {
76      private static final Logger LOG = Logger.getLogger(EntityBioDemographics.class);
77  
78      @XmlElement(name = Elements.ENTITY_ID, required = false)
79      private final String entityId;
80      @XmlElement(name = Elements.DECEASED_DATE, required = false)
81      private final String deceasedDate;
82      @XmlElement(name = Elements.BIRTH_DATE, required = false)
83      private final String birthDate;
84      @XmlElement(name = Elements.GENDER_CODE, required = false)
85      private final String genderCode;
86      @XmlElement(name = Elements.GENDER_CHANGE_CODE, required = false)
87      private final String genderChangeCode;
88      @XmlElement(name = Elements.MARITAL_STATUS_CODE, required = false)
89      private final String maritalStatusCode;
90      @XmlElement(name = Elements.PRIMARY_LANGUAGE_CODE, required = false)
91      private final String primaryLanguageCode;
92      @XmlElement(name = Elements.SECONDARY_LANGUAGE_CODE, required = false)
93      private final String secondaryLanguageCode;
94      @XmlElement(name = Elements.BIRTH_COUNTRY, required = false)
95      private final String birthCountry;
96      @XmlElement(name = Elements.BIRTH_STATE_PROVINCE_CODE, required = false)
97      private final String birthStateProvinceCode;
98      @XmlElement(name = Elements.BIRTH_CITY, required = false)
99      private final String birthCity;
100     @XmlElement(name = Elements.GEOGRAPHIC_ORIGIN, required = false)
101     private final String geographicOrigin;
102 
103     @XmlElement(name = Elements.BIRTH_DATE_UNMASKED, required = false)
104     private final String birthDateUnmasked;
105     @XmlElement(name = Elements.GENDER_CODE_UNMASKED, required = false)
106     private final String genderCodeUnmasked;
107     @XmlElement(name = Elements.GENDER_CHANGE_CODE_UNMASKED, required = false)
108     private final String genderChangeCodeUnmasked;
109     @XmlElement(name = Elements.MARITAL_STATUS_CODE_UNMASKED, required = false)
110     private final String maritalStatusCodeUnmasked;
111     @XmlElement(name = Elements.PRIMARY_LANGUAGE_CODE_UNMASKED, required = false)
112     private final String primaryLanguageCodeUnmasked;
113     @XmlElement(name = Elements.SECONDARY_LANGUAGE_CODE_UNMASKED, required = false)
114     private final String secondaryLanguageCodeUnmasked;
115     @XmlElement(name = Elements.BIRTH_COUNTRY_UNMASKED, required = false)
116     private final String birthCountryUnmasked;
117     @XmlElement(name = Elements.BIRTH_STATE_PROVINCE_CODE_UNMASKED, required = false)
118     private final String birthStateProvinceCodeUnmasked;
119     @XmlElement(name = Elements.BIRTH_CITY_UNMASKED, required = false)
120     private final String birthCityUnmasked;
121     @XmlElement(name = Elements.GEOGRAPHIC_ORIGIN_UNMASKED, required = false)
122     private final String geographicOriginUnmasked;
123 
124     @XmlElement(name = Elements.NOTE_MESSAGE, required = false)
125     private final String noteMessage;
126     @XmlElement(name = Elements.SUPPRESS_PERSONAL, required = true)
127     private final boolean suppressPersonal;
128     @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false)
129     private final Long versionNumber;
130     @XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false)
131     private final String objectId;
132     @SuppressWarnings("unused")
133     @XmlAnyElement
134     private final Collection<Element> _futureElements = null;
135 
136     /**
137      * Private constructor used only by JAXB.
138      * 
139      */
140     private EntityBioDemographics() {
141         this.entityId = null;
142         this.deceasedDate = null;
143         this.birthDate = null;
144         this.genderCode = null;
145         this.genderChangeCode = null;
146         this.maritalStatusCode = null;
147         this.primaryLanguageCode = null;
148         this.secondaryLanguageCode = null;
149         this.birthCountry = null;
150         this.birthStateProvinceCode = null;
151         this.birthCity = null;
152         this.geographicOrigin = null;
153 
154         this.birthDateUnmasked = null;
155         this.genderCodeUnmasked = null;
156         this.genderChangeCodeUnmasked = null;
157         this.maritalStatusCodeUnmasked = null;
158         this.primaryLanguageCodeUnmasked = null;
159         this.secondaryLanguageCodeUnmasked = null;
160         this.birthCountryUnmasked = null;
161         this.birthStateProvinceCodeUnmasked = null;
162         this.birthCityUnmasked = null;
163         this.geographicOriginUnmasked = null;
164 
165         this.noteMessage = null;
166         this.suppressPersonal = false;
167         this.versionNumber = null;
168         this.objectId = null;
169     }
170 
171     private EntityBioDemographics(Builder builder) {
172         this.entityId = builder.getEntityId();
173         this.deceasedDate = builder.getDeceasedDate();
174         this.birthDate = builder.getBirthDate();
175         this.genderCode = builder.getGenderCode();
176         this.genderChangeCode = builder.getGenderChangeCode();
177         this.maritalStatusCode = builder.getMaritalStatusCode();
178         this.primaryLanguageCode = builder.getPrimaryLanguageCode();
179         this.secondaryLanguageCode = builder.getSecondaryLanguageCode();
180         this.birthCountry = builder.getBirthCountry();
181         this.birthStateProvinceCode = builder.getBirthStateProvinceCode();
182         this.birthCity = builder.getBirthCity();
183         this.geographicOrigin = builder.getGeographicOrigin();
184 
185         this.birthDateUnmasked = builder.getBirthDateUnmasked();
186         this.genderCodeUnmasked = builder.getGenderCodeUnmasked();
187         this.genderChangeCodeUnmasked = builder.getGenderChangeCodeUnmasked();
188         this.maritalStatusCodeUnmasked = builder.getMaritalStatusCodeUnmasked();
189         this.primaryLanguageCodeUnmasked = builder.getPrimaryLanguageCodeUnmasked();
190         this.secondaryLanguageCodeUnmasked = builder.getSecondaryLanguageCodeUnmasked();
191         this.birthCountryUnmasked = builder.getBirthCountryUnmasked();
192         this.birthStateProvinceCodeUnmasked = builder.getBirthStateProvinceCodeUnmasked();
193         this.birthCityUnmasked = builder.getBirthCityUnmasked();
194         this.geographicOriginUnmasked = builder.getGeographicOriginUnmasked();
195 
196         this.noteMessage = builder.getNoteMessage();
197         this.suppressPersonal = builder.isSuppressPersonal();
198         this.versionNumber = builder.getVersionNumber();
199         this.objectId = builder.getObjectId();
200     }
201 
202     @Override
203     public String getEntityId() {
204         return this.entityId;
205     }
206 
207     @Override
208     public String getDeceasedDate() {
209         return this.deceasedDate;
210     }
211 
212     @Override
213     public String getBirthDate() {
214         return this.birthDate;
215     }
216 
217     @Override
218     @XmlElement(name = Elements.AGE, required = true)
219     public Integer getAge() {
220         return calculateAge(this.birthDate, this.deceasedDate, isSuppressPersonal());
221     }
222 
223     @Override
224     public String getGenderCode() {
225         return this.genderCode;
226     }
227 
228     @Override
229     public String getGenderChangeCode() {
230         return this.genderChangeCode;
231     }
232 
233     @Override
234     public String getMaritalStatusCode() {
235         return this.maritalStatusCode;
236     }
237 
238     @Override
239     public String getPrimaryLanguageCode() {
240         return this.primaryLanguageCode;
241     }
242 
243     @Override
244     public String getSecondaryLanguageCode() {
245         return this.secondaryLanguageCode;
246     }
247 
248     @Override
249     public String getBirthCountry() {
250         return this.birthCountry;
251     }
252 
253     @Override
254     public String getBirthStateProvinceCode() {
255         return this.birthStateProvinceCode;
256     }
257 
258     @Override
259     public String getBirthCity() {
260         return this.birthCity;
261     }
262 
263     @Override
264     public String getGeographicOrigin() {
265         return this.geographicOrigin;
266     }
267 
268     @Override
269     public String getBirthDateUnmasked() {
270         return this.birthDateUnmasked;
271     }
272 
273     @Override
274     public String getGenderCodeUnmasked() {
275         return this.genderCodeUnmasked;
276     }
277 
278     @Override
279     public String getGenderChangeCodeUnmasked() {
280         return this.genderChangeCodeUnmasked;
281     }
282     
283     @Override
284     public String getMaritalStatusCodeUnmasked() {
285         return this.maritalStatusCodeUnmasked;
286     }
287 
288     @Override
289     public String getPrimaryLanguageCodeUnmasked() {
290         return this.primaryLanguageCodeUnmasked;
291     }
292 
293     @Override
294     public String getSecondaryLanguageCodeUnmasked() {
295         return this.secondaryLanguageCodeUnmasked;
296     }
297 
298     @Override
299     public String getBirthCountryUnmasked() {
300         return this.birthCountryUnmasked;
301     }
302 
303     @Override
304     public String getBirthStateProvinceCodeUnmasked() {
305         return this.birthStateProvinceCodeUnmasked;
306     }
307 
308     @Override
309     public String getBirthCityUnmasked() {
310         return this.birthCityUnmasked;
311     }
312 
313     @Override
314     public String getGeographicOriginUnmasked() {
315         return this.geographicOriginUnmasked;
316     }
317 
318     @Override
319     public String getNoteMessage() {
320         return this.noteMessage;
321     }
322 
323     @Override
324     public boolean isSuppressPersonal() {
325         return this.suppressPersonal;
326     }
327 
328     @Override
329     public Long getVersionNumber() {
330         return this.versionNumber;
331     }
332 
333     @Override
334     public String getObjectId() {
335         return this.objectId;
336     }
337 
338     /**
339      * Helper to parse the birth date for age calculation
340      * @param birthDate the birth date in EntityBioDemographicsContract BIRTH_DATE_FORMAT format
341      * @param deceasedDate the deceased date in EntityBioDemographicsContract DECEASED_DATE_FORMAT format
342      * @param suppressPersonal whether personal information is being suppressed
343      * @return the age in years or null if unavailable, suppressed, or an error occurs during calculation
344      */
345     private static Integer calculateAge(String birthDate, String deceasedDate, boolean suppressPersonal) {
346         if (birthDate != null && ! suppressPersonal) {
347             Date parsedBirthDate;
348             try {
349                 parsedBirthDate = new SimpleDateFormat(BIRTH_DATE_FORMAT).parse(birthDate);
350             } catch (ParseException pe) {
351                 LOG.error("Error parsing EntityBioDemographics birth date: '" + birthDate + "'", pe);
352                 return null;
353             }
354             DateTime endDate;
355             if (deceasedDate != null) {
356                 try {
357                    endDate = new DateTime(new SimpleDateFormat(BIRTH_DATE_FORMAT).parse(deceasedDate));
358                 } catch (ParseException pe) {
359                     LOG.error("Error parsing EntityBioDemographics deceased date: '" + deceasedDate+ "'", pe);
360                     return null;
361                 }
362             } else {
363                 endDate = new DateTime();
364             }
365             return Years.yearsBetween(new DateTime(parsedBirthDate), endDate).getYears();
366         }
367         return null;
368     }
369 
370     /**
371      * A builder which can be used to construct {@link EntityBioDemographics} instances.  Enforces the constraints of the {@link EntityBioDemographicsContract}.
372      * 
373      */
374     public final static class Builder
375         implements Serializable, ModelBuilder, EntityBioDemographicsContract
376     {
377 
378         private String entityId;
379         private String deceasedDate;
380         private String birthDate;
381         private String genderCode;
382         private String maritalStatusCode;
383         private String primaryLanguageCode;
384         private String secondaryLanguageCode;
385         private String birthCountry;
386         private String birthStateProvinceCode;
387         private String birthCity;
388         private String geographicOrigin;
389         private String genderChangeCode;
390         private String noteMessage;
391         private boolean suppressPersonal;
392         private Long versionNumber;
393         private String objectId;
394 
395         private Builder(String entityId, String genderCode) {
396             setEntityId(entityId);
397             setGenderCode(genderCode);
398         }
399 
400         public static Builder create(String entityId, String genderCode) {
401             // TODO modify as needed to pass any required values and add them to the signature of the 'create' method
402             return new Builder(entityId, genderCode);
403         }
404 
405         public static Builder create(EntityBioDemographicsContract contract) {
406             if (contract == null) {
407                 throw new IllegalArgumentException("contract was null");
408             }
409             Builder builder = create(contract.getEntityId(), contract.getGenderCode());
410             builder.setDeceasedDate(contract.getDeceasedDate());
411             builder.setBirthDate(contract.getBirthDate());
412             builder.setMaritalStatusCode(contract.getMaritalStatusCode());
413             builder.setPrimaryLanguageCode(contract.getPrimaryLanguageCode());
414             builder.setSecondaryLanguageCode(contract.getSecondaryLanguageCode());
415             builder.setBirthCountry(contract.getBirthCountry());
416             builder.setBirthStateProvinceCode(contract.getBirthStateProvinceCode());
417             builder.setBirthCity(contract.getBirthCity());
418             builder.setGeographicOrigin(contract.getGeographicOrigin());
419             builder.setGenderChangeCode(contract.getGenderChangeCode());
420             builder.setNoteMessage(contract.getNoteMessage());
421             builder.setSuppressPersonal(contract.isSuppressPersonal());
422             builder.setVersionNumber(contract.getVersionNumber());
423             builder.setObjectId(contract.getObjectId());
424             return builder;
425         }
426 
427         public EntityBioDemographics build() {
428             return new EntityBioDemographics(this);
429         }
430 
431         @Override
432         public String getEntityId() {
433             return this.entityId;
434         }
435 
436         @Override
437         public String getDeceasedDate() {
438             return this.deceasedDate;
439         }
440 
441         @Override
442         public String getBirthDate() {
443             if (isSuppressPersonal()) {
444                 return KimConstants.RESTRICTED_DATA_MASK;
445             }
446             return this.birthDate;
447         }
448 
449         @Override
450         public Integer getAge() {
451             return calculateAge(this.birthDate, this.deceasedDate, isSuppressPersonal());
452         }
453 
454         @Override
455         public String getGenderCode() {
456             if (isSuppressPersonal()) {
457                 return KimConstants.RESTRICTED_DATA_MASK;
458             }
459             return this.genderCode;
460         }
461 
462         @Override
463         public String getGenderChangeCode() {
464             if (isSuppressPersonal()) {
465                 return KimConstants.RESTRICTED_DATA_MASK;
466             }
467             return this.genderChangeCode;
468         }
469 
470         @Override
471         public String getMaritalStatusCode() {
472             if (isSuppressPersonal()) {
473                 return KimConstants.RESTRICTED_DATA_MASK;
474             }
475             return this.maritalStatusCode;
476         }
477 
478         @Override
479         public String getPrimaryLanguageCode() {
480             if (isSuppressPersonal()) {
481                 return KimConstants.RESTRICTED_DATA_MASK;
482             }
483             return this.primaryLanguageCode;
484         }
485 
486         @Override
487         public String getSecondaryLanguageCode() {
488             if (isSuppressPersonal()) {
489                 return KimConstants.RESTRICTED_DATA_MASK;
490             }
491             return this.secondaryLanguageCode;
492         }
493 
494         @Override
495         public String getBirthCountry() {
496             if (isSuppressPersonal()) {
497                 return KimConstants.RESTRICTED_DATA_MASK;
498             }
499             return this.birthCountry;
500         }
501 
502         @Override
503         public String getBirthStateProvinceCode() {
504             if (isSuppressPersonal()) {
505                 return KimConstants.RESTRICTED_DATA_MASK;
506             }
507             return this.birthStateProvinceCode;
508         }
509 
510         @Override
511         public String getBirthCity() {
512             if (isSuppressPersonal()) {
513                 return KimConstants.RESTRICTED_DATA_MASK;
514             }
515             return this.birthCity;
516         }
517 
518         @Override
519         public String getGeographicOrigin() {
520             if (isSuppressPersonal()) {
521                 return KimConstants.RESTRICTED_DATA_MASK;
522             }
523             return this.geographicOrigin;
524         }
525 
526         @Override
527         public String getBirthDateUnmasked() {
528             return this.birthDate;
529         }
530 
531         @Override
532         public String getGenderCodeUnmasked() {
533             return this.genderCode;
534         }
535 
536         @Override
537         public String getGenderChangeCodeUnmasked() {
538             return this.genderChangeCode;
539         }
540 
541         @Override
542         public String getMaritalStatusCodeUnmasked() {
543             return this.maritalStatusCode;
544         }
545 
546         @Override
547         public String getPrimaryLanguageCodeUnmasked() {
548             return this.primaryLanguageCode;
549         }
550 
551         @Override
552         public String getSecondaryLanguageCodeUnmasked() {
553             return this.secondaryLanguageCode;
554         }
555 
556         @Override
557         public String getBirthCountryUnmasked() {
558             return this.birthCountry;
559         }
560 
561         @Override
562         public String getBirthStateProvinceCodeUnmasked() {
563             return this.birthStateProvinceCode;
564         }
565 
566         @Override
567         public String getBirthCityUnmasked() {
568             return this.birthCity;
569         }
570 
571         @Override
572         public String getGeographicOriginUnmasked() {
573             return this.geographicOrigin;
574         }
575 
576         @Override
577         public String getNoteMessage() {
578             return this.noteMessage;
579         }
580 
581         @Override
582         public boolean isSuppressPersonal() {
583             return this.suppressPersonal;
584         }
585 
586         @Override
587         public Long getVersionNumber() {
588             return this.versionNumber;
589         }
590 
591         @Override
592         public String getObjectId() {
593             return this.objectId;
594         }
595 
596         public void setEntityId(String entityId) {
597             if (StringUtils.isEmpty(entityId)) {
598                 throw new IllegalArgumentException("id is empty");
599             }
600             this.entityId = entityId;
601         }
602 
603         public void setDeceasedDate(String deceasedDate) {
604             if (deceasedDate != null) {
605                 SimpleDateFormat format = new SimpleDateFormat(DECEASED_DATE_FORMAT);
606                 try{
607                     format.parse(deceasedDate);
608                     this.deceasedDate = deceasedDate;
609                 }
610                 catch(ParseException e) {
611                     throw new IllegalArgumentException("deceasedDate is not of the format 'yyyy-MM-DD'");
612                 }
613             }
614         }
615 
616         public void setBirthDate(String birthDate) {
617             if (birthDate != null) {
618                 SimpleDateFormat format = new SimpleDateFormat(BIRTH_DATE_FORMAT);
619                 try{
620                     format.parse(birthDate);
621                     this.birthDate = birthDate;
622                 }
623                 catch(ParseException e) {
624                     throw new IllegalArgumentException("birthDate is not of the format 'yyyy-MM-DD'");
625                 }
626             }
627         }
628 
629         public void setDeceasedDate(Date deceasedDate) {
630             this.deceasedDate = new SimpleDateFormat(DECEASED_DATE_FORMAT).format(deceasedDate);
631         }
632 
633         public void setBirthDate(Date birthDate) {
634             this.birthDate = new SimpleDateFormat(BIRTH_DATE_FORMAT).format(birthDate);
635         }
636 
637         public void setGenderCode(String genderCode) {
638             if (StringUtils.isEmpty(genderCode)) {
639                 throw new IllegalArgumentException("genderCode is empty");
640             }
641             this.genderCode = genderCode;
642         }
643 
644         public void setGenderChangeCode(String genderChangeCode) {
645             this.genderChangeCode = genderChangeCode;
646         }
647 
648         public void setMaritalStatusCode(String maritalStatusCode) {
649             this.maritalStatusCode = maritalStatusCode;
650         }
651 
652         public void setPrimaryLanguageCode(String primaryLanguageCode) {
653             this.primaryLanguageCode = primaryLanguageCode;
654         }
655 
656         public void setSecondaryLanguageCode(String secondaryLanguageCode) {
657             this.secondaryLanguageCode = secondaryLanguageCode;
658         }
659 
660         public void setBirthCountry(String birthCountry) {
661             this.birthCountry = birthCountry;
662         }
663 
664         public void setBirthStateProvinceCode(String birthStateProvinceCode) {
665             this.birthStateProvinceCode = birthStateProvinceCode;
666         }
667 
668         public void setBirthCity(String birthCity) {
669             this.birthCity = birthCity;
670         }
671 
672         public void setGeographicOrigin(String geographicOrigin) {
673             this.geographicOrigin = geographicOrigin;
674         }
675 
676         private void setNoteMessage(String noteMessage) {
677             this.noteMessage = noteMessage;
678         }
679 
680         private void setSuppressPersonal(boolean suppressPersonal) {
681             this.suppressPersonal = suppressPersonal;
682         }
683 
684         public void setVersionNumber(Long versionNumber) {
685             this.versionNumber = versionNumber;
686         }
687 
688         public void setObjectId(String objectId) {
689             this.objectId = objectId;
690         }
691 
692         }
693 
694 
695     /**
696      * Defines some internal constants used on this class.
697      * 
698      */
699     static class Constants {
700 
701         final static String ROOT_ELEMENT_NAME = "entityBioDemographics";
702         final static String TYPE_NAME = "EntityBioDemographicsType";
703     }
704 
705 
706     /**
707      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
708      * 
709      */
710     static class Elements {
711 
712         final static String ENTITY_ID = "entityId";
713         final static String DECEASED_DATE = "deceasedDate";
714         final static String BIRTH_DATE = "birthDate";
715         final static String AGE = "age";
716         final static String GENDER_CODE = "genderCode";
717         final static String MARITAL_STATUS_CODE = "maritalStatusCode";
718         final static String PRIMARY_LANGUAGE_CODE = "primaryLanguageCode";
719         final static String SECONDARY_LANGUAGE_CODE = "secondaryLanguageCode";
720         final static String BIRTH_COUNTRY = "birthCountry";
721         final static String BIRTH_STATE_PROVINCE_CODE = "birthStateProvinceCode";
722         final static String BIRTH_CITY = "birthCity";
723         final static String GEOGRAPHIC_ORIGIN = "geographicOrigin";
724         final static String BIRTH_DATE_UNMASKED = "birthDateUnmasked";
725         final static String GENDER_CODE_UNMASKED = "genderCodeUnmasked";
726         final static String MARITAL_STATUS_CODE_UNMASKED = "maritalStatusCodeUnmasked";
727         final static String PRIMARY_LANGUAGE_CODE_UNMASKED = "primaryLanguageCodeUnmasked";
728         final static String SECONDARY_LANGUAGE_CODE_UNMASKED = "secondaryLanguageCodeUnmasked";
729         final static String BIRTH_COUNTRY_UNMASKED = "birthCountryUnmasked";
730         final static String BIRTH_STATE_PROVINCE_CODE_UNMASKED = "birthStateProvinceCodeUnmasked";
731         final static String BIRTH_CITY_UNMASKED = "birthCityUnmasked";
732         final static String GEOGRAPHIC_ORIGIN_UNMASKED = "geographicOriginUnmasked";
733         final static String GENDER_CHANGE_CODE = "genderChangeCode";
734         final static String GENDER_CHANGE_CODE_UNMASKED = "genderChangeCodeUnmasked";
735         final static String NOTE_MESSAGE = "noteMessage";
736         final static String SUPPRESS_PERSONAL = "suppressPersonal";
737 
738     }
739 
740 }