View Javadoc

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