001// --------------------------------------------------------------------------------
002// Copyright 2002-2026 Echo Three, LLC
003//
004// Licensed under the Apache License, Version 2.0 (the "License");
005// you may not use this file except in compliance with the License.
006// You may obtain a copy of the License at
007//
008//     http://www.apache.org/licenses/LICENSE-2.0
009//
010// Unless required by applicable law or agreed to in writing, software
011// distributed under the License is distributed on an "AS IS" BASIS,
012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013// See the License for the specific language governing permissions and
014// limitations under the License.
015// --------------------------------------------------------------------------------
016// Generated File -- DO NOT EDIT BY HAND
017// --------------------------------------------------------------------------------
018
019/**
020 * ContactPostalAddress.java
021 */
022
023package com.echothree.model.data.contact.server.entity;
024
025import com.echothree.model.data.contact.common.pk.ContactPostalAddressPK;
026
027import com.echothree.model.data.contact.common.pk.ContactMechanismPK;
028import com.echothree.model.data.party.common.pk.PersonalTitlePK;
029import com.echothree.model.data.party.common.pk.NameSuffixPK;
030import com.echothree.model.data.geo.common.pk.GeoCodePK;
031
032import com.echothree.model.data.contact.server.entity.ContactMechanism;
033import com.echothree.model.data.party.server.entity.PersonalTitle;
034import com.echothree.model.data.party.server.entity.NameSuffix;
035import com.echothree.model.data.geo.server.entity.GeoCode;
036
037import com.echothree.model.data.contact.server.factory.ContactMechanismFactory;
038import com.echothree.model.data.party.server.factory.PersonalTitleFactory;
039import com.echothree.model.data.party.server.factory.NameSuffixFactory;
040import com.echothree.model.data.geo.server.factory.GeoCodeFactory;
041
042import com.echothree.model.data.contact.common.pk.ContactPostalAddressPK;
043
044import com.echothree.model.data.contact.server.value.ContactPostalAddressValue;
045
046import com.echothree.model.data.contact.server.factory.ContactPostalAddressFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064import javax.annotation.Nonnull;
065import javax.annotation.Nullable;
066
067public class ContactPostalAddress
068        extends BaseEntity
069        implements Serializable {
070    
071    private ContactPostalAddressPK _pk;
072    private ContactPostalAddressValue _value;
073    
074    /** Creates a new instance of ContactPostalAddress */
075    public ContactPostalAddress()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of ContactPostalAddress */
081    public ContactPostalAddress(ContactPostalAddressValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    @Nonnull
090    public ContactPostalAddressFactory getBaseFactoryInstance() {
091        return ContactPostalAddressFactory.getInstance();
092    }
093    
094    @Override
095    public boolean hasBeenModified() {
096        return _value.hasBeenModified();
097    }
098    
099    @Override
100    public int hashCode() {
101        return _pk.hashCode();
102    }
103    
104    @Override
105    @Nonnull
106    public String toString() {
107        return _pk.toString();
108    }
109    
110    @Override
111    public boolean equals(Object other) {
112        if(this == other)
113            return true;
114        
115        if(other instanceof ContactPostalAddress that) {
116            ContactPostalAddressValue thatValue = that.getContactPostalAddressValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store()
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(this);
133    }
134    
135    @Nonnull
136    public ContactPostalAddressValue getContactPostalAddressValue() {
137        return _value;
138    }
139    
140    public void setContactPostalAddressValue(@Nonnull ContactPostalAddressValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    @Nonnull
148    public ContactPostalAddressPK getPrimaryKey() {
149        return _pk;
150    }
151    
152    @Nonnull
153    public ContactMechanismPK getContactMechanismPK() {
154        return _value.getContactMechanismPK();
155    }
156    
157    @Nonnull
158    public ContactMechanism getContactMechanism(EntityPermission entityPermission) {
159        return ContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getContactMechanismPK());
160    }
161    
162    @Nonnull
163    public ContactMechanism getContactMechanism() {
164        return getContactMechanism(EntityPermission.READ_ONLY);
165    }
166    
167    @Nonnull
168    public ContactMechanism getContactMechanismForUpdate() {
169        return getContactMechanism(EntityPermission.READ_WRITE);
170    }
171    
172    public void setContactMechanismPK(@Nonnull ContactMechanismPK contactMechanismPK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setContactMechanismPK(contactMechanismPK);
176    }
177    
178    public void setContactMechanism(@Nonnull ContactMechanism entity) {
179        setContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
180    }
181    
182    public boolean getContactMechanismPKHasBeenModified() {
183        return _value.getContactMechanismPKHasBeenModified();
184    }
185    
186    @Nullable
187    public PersonalTitlePK getPersonalTitlePK() {
188        return _value.getPersonalTitlePK();
189    }
190    
191    @Nullable
192    public PersonalTitle getPersonalTitle(EntityPermission entityPermission) {
193        PersonalTitlePK pk = getPersonalTitlePK();
194        PersonalTitle entity = pk == null? null: PersonalTitleFactory.getInstance().getEntityFromPK(entityPermission, pk);
195        
196        return entity;
197    }
198    
199    @Nullable
200    public PersonalTitle getPersonalTitle() {
201        return getPersonalTitle(EntityPermission.READ_ONLY);
202    }
203    
204    @Nullable
205    public PersonalTitle getPersonalTitleForUpdate() {
206        return getPersonalTitle(EntityPermission.READ_WRITE);
207    }
208    
209    public void setPersonalTitlePK(@Nullable PersonalTitlePK personalTitlePK)
210            throws PersistenceNotNullException, PersistenceReadOnlyException {
211        checkReadWrite();
212        _value.setPersonalTitlePK(personalTitlePK);
213    }
214    
215    public void setPersonalTitle(@Nullable PersonalTitle entity) {
216        setPersonalTitlePK(entity == null ? null : entity.getPrimaryKey());
217    }
218    
219    public boolean getPersonalTitlePKHasBeenModified() {
220        return _value.getPersonalTitlePKHasBeenModified();
221    }
222    
223    @Nullable
224    public String getFirstName() {
225        return _value.getFirstName();
226    }
227    
228    public void setFirstName(@Nullable String firstName)
229            throws PersistenceNotNullException, PersistenceReadOnlyException {
230        checkReadWrite();
231        _value.setFirstName(firstName);
232    }
233    
234    public boolean getFirstNameHasBeenModified() {
235        return _value.getFirstNameHasBeenModified();
236    }
237    
238    @Nullable
239    public String getFirstNameSdx() {
240        return _value.getFirstNameSdx();
241    }
242    
243    public void setFirstNameSdx(@Nullable String firstNameSdx)
244            throws PersistenceNotNullException, PersistenceReadOnlyException {
245        checkReadWrite();
246        _value.setFirstNameSdx(firstNameSdx);
247    }
248    
249    public boolean getFirstNameSdxHasBeenModified() {
250        return _value.getFirstNameSdxHasBeenModified();
251    }
252    
253    @Nullable
254    public String getMiddleName() {
255        return _value.getMiddleName();
256    }
257    
258    public void setMiddleName(@Nullable String middleName)
259            throws PersistenceNotNullException, PersistenceReadOnlyException {
260        checkReadWrite();
261        _value.setMiddleName(middleName);
262    }
263    
264    public boolean getMiddleNameHasBeenModified() {
265        return _value.getMiddleNameHasBeenModified();
266    }
267    
268    @Nullable
269    public String getMiddleNameSdx() {
270        return _value.getMiddleNameSdx();
271    }
272    
273    public void setMiddleNameSdx(@Nullable String middleNameSdx)
274            throws PersistenceNotNullException, PersistenceReadOnlyException {
275        checkReadWrite();
276        _value.setMiddleNameSdx(middleNameSdx);
277    }
278    
279    public boolean getMiddleNameSdxHasBeenModified() {
280        return _value.getMiddleNameSdxHasBeenModified();
281    }
282    
283    @Nullable
284    public String getLastName() {
285        return _value.getLastName();
286    }
287    
288    public void setLastName(@Nullable String lastName)
289            throws PersistenceNotNullException, PersistenceReadOnlyException {
290        checkReadWrite();
291        _value.setLastName(lastName);
292    }
293    
294    public boolean getLastNameHasBeenModified() {
295        return _value.getLastNameHasBeenModified();
296    }
297    
298    @Nullable
299    public String getLastNameSdx() {
300        return _value.getLastNameSdx();
301    }
302    
303    public void setLastNameSdx(@Nullable String lastNameSdx)
304            throws PersistenceNotNullException, PersistenceReadOnlyException {
305        checkReadWrite();
306        _value.setLastNameSdx(lastNameSdx);
307    }
308    
309    public boolean getLastNameSdxHasBeenModified() {
310        return _value.getLastNameSdxHasBeenModified();
311    }
312    
313    @Nullable
314    public NameSuffixPK getNameSuffixPK() {
315        return _value.getNameSuffixPK();
316    }
317    
318    @Nullable
319    public NameSuffix getNameSuffix(EntityPermission entityPermission) {
320        NameSuffixPK pk = getNameSuffixPK();
321        NameSuffix entity = pk == null? null: NameSuffixFactory.getInstance().getEntityFromPK(entityPermission, pk);
322        
323        return entity;
324    }
325    
326    @Nullable
327    public NameSuffix getNameSuffix() {
328        return getNameSuffix(EntityPermission.READ_ONLY);
329    }
330    
331    @Nullable
332    public NameSuffix getNameSuffixForUpdate() {
333        return getNameSuffix(EntityPermission.READ_WRITE);
334    }
335    
336    public void setNameSuffixPK(@Nullable NameSuffixPK nameSuffixPK)
337            throws PersistenceNotNullException, PersistenceReadOnlyException {
338        checkReadWrite();
339        _value.setNameSuffixPK(nameSuffixPK);
340    }
341    
342    public void setNameSuffix(@Nullable NameSuffix entity) {
343        setNameSuffixPK(entity == null ? null : entity.getPrimaryKey());
344    }
345    
346    public boolean getNameSuffixPKHasBeenModified() {
347        return _value.getNameSuffixPKHasBeenModified();
348    }
349    
350    @Nullable
351    public String getCompanyName() {
352        return _value.getCompanyName();
353    }
354    
355    public void setCompanyName(@Nullable String companyName)
356            throws PersistenceNotNullException, PersistenceReadOnlyException {
357        checkReadWrite();
358        _value.setCompanyName(companyName);
359    }
360    
361    public boolean getCompanyNameHasBeenModified() {
362        return _value.getCompanyNameHasBeenModified();
363    }
364    
365    @Nullable
366    public String getAttention() {
367        return _value.getAttention();
368    }
369    
370    public void setAttention(@Nullable String attention)
371            throws PersistenceNotNullException, PersistenceReadOnlyException {
372        checkReadWrite();
373        _value.setAttention(attention);
374    }
375    
376    public boolean getAttentionHasBeenModified() {
377        return _value.getAttentionHasBeenModified();
378    }
379    
380    @Nonnull
381    public String getAddress1() {
382        return _value.getAddress1();
383    }
384    
385    public void setAddress1(@Nonnull String address1)
386            throws PersistenceNotNullException, PersistenceReadOnlyException {
387        checkReadWrite();
388        _value.setAddress1(address1);
389    }
390    
391    public boolean getAddress1HasBeenModified() {
392        return _value.getAddress1HasBeenModified();
393    }
394    
395    @Nullable
396    public String getAddress2() {
397        return _value.getAddress2();
398    }
399    
400    public void setAddress2(@Nullable String address2)
401            throws PersistenceNotNullException, PersistenceReadOnlyException {
402        checkReadWrite();
403        _value.setAddress2(address2);
404    }
405    
406    public boolean getAddress2HasBeenModified() {
407        return _value.getAddress2HasBeenModified();
408    }
409    
410    @Nullable
411    public String getAddress3() {
412        return _value.getAddress3();
413    }
414    
415    public void setAddress3(@Nullable String address3)
416            throws PersistenceNotNullException, PersistenceReadOnlyException {
417        checkReadWrite();
418        _value.setAddress3(address3);
419    }
420    
421    public boolean getAddress3HasBeenModified() {
422        return _value.getAddress3HasBeenModified();
423    }
424    
425    @Nullable
426    public String getCity() {
427        return _value.getCity();
428    }
429    
430    public void setCity(@Nullable String city)
431            throws PersistenceNotNullException, PersistenceReadOnlyException {
432        checkReadWrite();
433        _value.setCity(city);
434    }
435    
436    public boolean getCityHasBeenModified() {
437        return _value.getCityHasBeenModified();
438    }
439    
440    @Nullable
441    public GeoCodePK getCityGeoCodePK() {
442        return _value.getCityGeoCodePK();
443    }
444    
445    @Nullable
446    public GeoCode getCityGeoCode(EntityPermission entityPermission) {
447        GeoCodePK pk = getCityGeoCodePK();
448        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk);
449        
450        return entity;
451    }
452    
453    @Nullable
454    public GeoCode getCityGeoCode() {
455        return getCityGeoCode(EntityPermission.READ_ONLY);
456    }
457    
458    @Nullable
459    public GeoCode getCityGeoCodeForUpdate() {
460        return getCityGeoCode(EntityPermission.READ_WRITE);
461    }
462    
463    public void setCityGeoCodePK(@Nullable GeoCodePK cityGeoCodePK)
464            throws PersistenceNotNullException, PersistenceReadOnlyException {
465        checkReadWrite();
466        _value.setCityGeoCodePK(cityGeoCodePK);
467    }
468    
469    public void setCityGeoCode(@Nullable GeoCode entity) {
470        setCityGeoCodePK(entity == null ? null : entity.getPrimaryKey());
471    }
472    
473    public boolean getCityGeoCodePKHasBeenModified() {
474        return _value.getCityGeoCodePKHasBeenModified();
475    }
476    
477    @Nullable
478    public GeoCodePK getCountyGeoCodePK() {
479        return _value.getCountyGeoCodePK();
480    }
481    
482    @Nullable
483    public GeoCode getCountyGeoCode(EntityPermission entityPermission) {
484        GeoCodePK pk = getCountyGeoCodePK();
485        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk);
486        
487        return entity;
488    }
489    
490    @Nullable
491    public GeoCode getCountyGeoCode() {
492        return getCountyGeoCode(EntityPermission.READ_ONLY);
493    }
494    
495    @Nullable
496    public GeoCode getCountyGeoCodeForUpdate() {
497        return getCountyGeoCode(EntityPermission.READ_WRITE);
498    }
499    
500    public void setCountyGeoCodePK(@Nullable GeoCodePK countyGeoCodePK)
501            throws PersistenceNotNullException, PersistenceReadOnlyException {
502        checkReadWrite();
503        _value.setCountyGeoCodePK(countyGeoCodePK);
504    }
505    
506    public void setCountyGeoCode(@Nullable GeoCode entity) {
507        setCountyGeoCodePK(entity == null ? null : entity.getPrimaryKey());
508    }
509    
510    public boolean getCountyGeoCodePKHasBeenModified() {
511        return _value.getCountyGeoCodePKHasBeenModified();
512    }
513    
514    @Nullable
515    public String getState() {
516        return _value.getState();
517    }
518    
519    public void setState(@Nullable String state)
520            throws PersistenceNotNullException, PersistenceReadOnlyException {
521        checkReadWrite();
522        _value.setState(state);
523    }
524    
525    public boolean getStateHasBeenModified() {
526        return _value.getStateHasBeenModified();
527    }
528    
529    @Nullable
530    public GeoCodePK getStateGeoCodePK() {
531        return _value.getStateGeoCodePK();
532    }
533    
534    @Nullable
535    public GeoCode getStateGeoCode(EntityPermission entityPermission) {
536        GeoCodePK pk = getStateGeoCodePK();
537        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk);
538        
539        return entity;
540    }
541    
542    @Nullable
543    public GeoCode getStateGeoCode() {
544        return getStateGeoCode(EntityPermission.READ_ONLY);
545    }
546    
547    @Nullable
548    public GeoCode getStateGeoCodeForUpdate() {
549        return getStateGeoCode(EntityPermission.READ_WRITE);
550    }
551    
552    public void setStateGeoCodePK(@Nullable GeoCodePK stateGeoCodePK)
553            throws PersistenceNotNullException, PersistenceReadOnlyException {
554        checkReadWrite();
555        _value.setStateGeoCodePK(stateGeoCodePK);
556    }
557    
558    public void setStateGeoCode(@Nullable GeoCode entity) {
559        setStateGeoCodePK(entity == null ? null : entity.getPrimaryKey());
560    }
561    
562    public boolean getStateGeoCodePKHasBeenModified() {
563        return _value.getStateGeoCodePKHasBeenModified();
564    }
565    
566    @Nullable
567    public String getPostalCode() {
568        return _value.getPostalCode();
569    }
570    
571    public void setPostalCode(@Nullable String postalCode)
572            throws PersistenceNotNullException, PersistenceReadOnlyException {
573        checkReadWrite();
574        _value.setPostalCode(postalCode);
575    }
576    
577    public boolean getPostalCodeHasBeenModified() {
578        return _value.getPostalCodeHasBeenModified();
579    }
580    
581    @Nullable
582    public GeoCodePK getPostalCodeGeoCodePK() {
583        return _value.getPostalCodeGeoCodePK();
584    }
585    
586    @Nullable
587    public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) {
588        GeoCodePK pk = getPostalCodeGeoCodePK();
589        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk);
590        
591        return entity;
592    }
593    
594    @Nullable
595    public GeoCode getPostalCodeGeoCode() {
596        return getPostalCodeGeoCode(EntityPermission.READ_ONLY);
597    }
598    
599    @Nullable
600    public GeoCode getPostalCodeGeoCodeForUpdate() {
601        return getPostalCodeGeoCode(EntityPermission.READ_WRITE);
602    }
603    
604    public void setPostalCodeGeoCodePK(@Nullable GeoCodePK postalCodeGeoCodePK)
605            throws PersistenceNotNullException, PersistenceReadOnlyException {
606        checkReadWrite();
607        _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK);
608    }
609    
610    public void setPostalCodeGeoCode(@Nullable GeoCode entity) {
611        setPostalCodeGeoCodePK(entity == null ? null : entity.getPrimaryKey());
612    }
613    
614    public boolean getPostalCodeGeoCodePKHasBeenModified() {
615        return _value.getPostalCodeGeoCodePKHasBeenModified();
616    }
617    
618    @Nonnull
619    public GeoCodePK getCountryGeoCodePK() {
620        return _value.getCountryGeoCodePK();
621    }
622    
623    @Nonnull
624    public GeoCode getCountryGeoCode(EntityPermission entityPermission) {
625        return GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, getCountryGeoCodePK());
626    }
627    
628    @Nonnull
629    public GeoCode getCountryGeoCode() {
630        return getCountryGeoCode(EntityPermission.READ_ONLY);
631    }
632    
633    @Nonnull
634    public GeoCode getCountryGeoCodeForUpdate() {
635        return getCountryGeoCode(EntityPermission.READ_WRITE);
636    }
637    
638    public void setCountryGeoCodePK(@Nonnull GeoCodePK countryGeoCodePK)
639            throws PersistenceNotNullException, PersistenceReadOnlyException {
640        checkReadWrite();
641        _value.setCountryGeoCodePK(countryGeoCodePK);
642    }
643    
644    public void setCountryGeoCode(@Nonnull GeoCode entity) {
645        setCountryGeoCodePK(entity == null ? null : entity.getPrimaryKey());
646    }
647    
648    public boolean getCountryGeoCodePKHasBeenModified() {
649        return _value.getCountryGeoCodePKHasBeenModified();
650    }
651    
652    @Nonnull
653    public Boolean getIsCommercial() {
654        return _value.getIsCommercial();
655    }
656    
657    public void setIsCommercial(@Nonnull Boolean isCommercial)
658            throws PersistenceNotNullException, PersistenceReadOnlyException {
659        checkReadWrite();
660        _value.setIsCommercial(isCommercial);
661    }
662    
663    public boolean getIsCommercialHasBeenModified() {
664        return _value.getIsCommercialHasBeenModified();
665    }
666    
667    @Nonnull
668    public Long getFromTime() {
669        return _value.getFromTime();
670    }
671    
672    public void setFromTime(@Nonnull Long fromTime)
673            throws PersistenceNotNullException, PersistenceReadOnlyException {
674        checkReadWrite();
675        _value.setFromTime(fromTime);
676    }
677    
678    public boolean getFromTimeHasBeenModified() {
679        return _value.getFromTimeHasBeenModified();
680    }
681    
682    @Nonnull
683    public Long getThruTime() {
684        return _value.getThruTime();
685    }
686    
687    public void setThruTime(@Nonnull Long thruTime)
688            throws PersistenceNotNullException, PersistenceReadOnlyException {
689        checkReadWrite();
690        _value.setThruTime(thruTime);
691    }
692    
693    public boolean getThruTimeHasBeenModified() {
694        return _value.getThruTimeHasBeenModified();
695    }
696    
697}