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 * ContactPostalAddressValue.java
021 */
022
023package com.echothree.model.data.contact.server.value;
024
025import com.echothree.model.data.contact.common.pk.ContactPostalAddressPK;
026
027import com.echothree.model.data.contact.server.factory.ContactPostalAddressFactory;
028
029import com.echothree.model.data.contact.common.pk.ContactMechanismPK;
030import com.echothree.model.data.party.common.pk.PersonalTitlePK;
031import com.echothree.model.data.party.common.pk.NameSuffixPK;
032import com.echothree.model.data.geo.common.pk.GeoCodePK;
033
034import com.echothree.util.common.exception.PersistenceCloneException;
035import com.echothree.util.common.exception.PersistenceNotNullException;
036
037import com.echothree.util.server.persistence.BaseValue;
038
039import java.io.Serializable;
040
041import javax.annotation.Nonnull;
042import javax.annotation.Nullable;
043
044public class ContactPostalAddressValue
045        extends BaseValue<ContactPostalAddressPK>
046        implements Cloneable, Serializable {
047    
048    private ContactMechanismPK contactMechanismPK;
049    private boolean contactMechanismPKHasBeenModified = false;
050    private PersonalTitlePK personalTitlePK;
051    private boolean personalTitlePKHasBeenModified = false;
052    private String firstName;
053    private boolean firstNameHasBeenModified = false;
054    private String firstNameSdx;
055    private boolean firstNameSdxHasBeenModified = false;
056    private String middleName;
057    private boolean middleNameHasBeenModified = false;
058    private String middleNameSdx;
059    private boolean middleNameSdxHasBeenModified = false;
060    private String lastName;
061    private boolean lastNameHasBeenModified = false;
062    private String lastNameSdx;
063    private boolean lastNameSdxHasBeenModified = false;
064    private NameSuffixPK nameSuffixPK;
065    private boolean nameSuffixPKHasBeenModified = false;
066    private String companyName;
067    private boolean companyNameHasBeenModified = false;
068    private String attention;
069    private boolean attentionHasBeenModified = false;
070    private String address1;
071    private boolean address1HasBeenModified = false;
072    private String address2;
073    private boolean address2HasBeenModified = false;
074    private String address3;
075    private boolean address3HasBeenModified = false;
076    private String city;
077    private boolean cityHasBeenModified = false;
078    private GeoCodePK cityGeoCodePK;
079    private boolean cityGeoCodePKHasBeenModified = false;
080    private GeoCodePK countyGeoCodePK;
081    private boolean countyGeoCodePKHasBeenModified = false;
082    private String state;
083    private boolean stateHasBeenModified = false;
084    private GeoCodePK stateGeoCodePK;
085    private boolean stateGeoCodePKHasBeenModified = false;
086    private String postalCode;
087    private boolean postalCodeHasBeenModified = false;
088    private GeoCodePK postalCodeGeoCodePK;
089    private boolean postalCodeGeoCodePKHasBeenModified = false;
090    private GeoCodePK countryGeoCodePK;
091    private boolean countryGeoCodePKHasBeenModified = false;
092    private Boolean isCommercial;
093    private boolean isCommercialHasBeenModified = false;
094    private Long fromTime;
095    private boolean fromTimeHasBeenModified = false;
096    private Long thruTime;
097    private boolean thruTimeHasBeenModified = false;
098    
099    private transient Integer _hashCode = null;
100    private transient String _stringValue = null;
101    
102    private void constructFields(ContactMechanismPK contactMechanismPK, PersonalTitlePK personalTitlePK, String firstName, String firstNameSdx, String middleName, String middleNameSdx, String lastName, String lastNameSdx, NameSuffixPK nameSuffixPK, String companyName, String attention, String address1, String address2, String address3, String city, GeoCodePK cityGeoCodePK, GeoCodePK countyGeoCodePK, String state, GeoCodePK stateGeoCodePK, String postalCode, GeoCodePK postalCodeGeoCodePK, GeoCodePK countryGeoCodePK, Boolean isCommercial, Long fromTime, Long thruTime)
103            throws PersistenceNotNullException {
104        checkForNull(contactMechanismPK);
105        this.contactMechanismPK = contactMechanismPK;
106        this.personalTitlePK = personalTitlePK;
107        this.firstName = firstName;
108        this.firstNameSdx = firstNameSdx;
109        this.middleName = middleName;
110        this.middleNameSdx = middleNameSdx;
111        this.lastName = lastName;
112        this.lastNameSdx = lastNameSdx;
113        this.nameSuffixPK = nameSuffixPK;
114        this.companyName = companyName;
115        this.attention = attention;
116        checkForNull(address1);
117        this.address1 = address1;
118        this.address2 = address2;
119        this.address3 = address3;
120        this.city = city;
121        this.cityGeoCodePK = cityGeoCodePK;
122        this.countyGeoCodePK = countyGeoCodePK;
123        this.state = state;
124        this.stateGeoCodePK = stateGeoCodePK;
125        this.postalCode = postalCode;
126        this.postalCodeGeoCodePK = postalCodeGeoCodePK;
127        checkForNull(countryGeoCodePK);
128        this.countryGeoCodePK = countryGeoCodePK;
129        checkForNull(isCommercial);
130        this.isCommercial = isCommercial;
131        checkForNull(fromTime);
132        this.fromTime = fromTime;
133        checkForNull(thruTime);
134        this.thruTime = thruTime;
135    }
136    
137    /** Creates a new instance of ContactPostalAddressValue */
138    public ContactPostalAddressValue(ContactPostalAddressPK contactPostalAddressPK, ContactMechanismPK contactMechanismPK, PersonalTitlePK personalTitlePK, String firstName, String firstNameSdx, String middleName, String middleNameSdx, String lastName, String lastNameSdx, NameSuffixPK nameSuffixPK, String companyName, String attention, String address1, String address2, String address3, String city, GeoCodePK cityGeoCodePK, GeoCodePK countyGeoCodePK, String state, GeoCodePK stateGeoCodePK, String postalCode, GeoCodePK postalCodeGeoCodePK, GeoCodePK countryGeoCodePK, Boolean isCommercial, Long fromTime, Long thruTime)
139            throws PersistenceNotNullException {
140        super(contactPostalAddressPK);
141        constructFields(contactMechanismPK, personalTitlePK, firstName, firstNameSdx, middleName, middleNameSdx, lastName, lastNameSdx, nameSuffixPK, companyName, attention, address1, address2, address3, city, cityGeoCodePK, countyGeoCodePK, state, stateGeoCodePK, postalCode, postalCodeGeoCodePK, countryGeoCodePK, isCommercial, fromTime, thruTime);
142    }
143    
144    /** Creates a new instance of ContactPostalAddressValue */
145    public ContactPostalAddressValue(ContactMechanismPK contactMechanismPK, PersonalTitlePK personalTitlePK, String firstName, String firstNameSdx, String middleName, String middleNameSdx, String lastName, String lastNameSdx, NameSuffixPK nameSuffixPK, String companyName, String attention, String address1, String address2, String address3, String city, GeoCodePK cityGeoCodePK, GeoCodePK countyGeoCodePK, String state, GeoCodePK stateGeoCodePK, String postalCode, GeoCodePK postalCodeGeoCodePK, GeoCodePK countryGeoCodePK, Boolean isCommercial, Long fromTime, Long thruTime)
146            throws PersistenceNotNullException {
147        super();
148        constructFields(contactMechanismPK, personalTitlePK, firstName, firstNameSdx, middleName, middleNameSdx, lastName, lastNameSdx, nameSuffixPK, companyName, attention, address1, address2, address3, city, cityGeoCodePK, countyGeoCodePK, state, stateGeoCodePK, postalCode, postalCodeGeoCodePK, countryGeoCodePK, isCommercial, fromTime, thruTime);
149    }
150    
151    @Override
152    @Nonnull
153    public ContactPostalAddressFactory getBaseFactoryInstance() {
154        return ContactPostalAddressFactory.getInstance();
155    }
156    
157    @Override
158    @Nonnull
159    public ContactPostalAddressValue clone() {
160        Object result;
161        
162        try {
163            result = super.clone();
164        } catch (CloneNotSupportedException cnse) {
165            // This shouldn't happen, fail when it does.
166            throw new PersistenceCloneException(cnse);
167        }
168        
169        return (ContactPostalAddressValue)result;
170    }
171    
172    @Override
173    @Nonnull
174    public ContactPostalAddressPK getPrimaryKey() {
175        if(_primaryKey == null) {
176            _primaryKey = new ContactPostalAddressPK(entityId);
177        }
178        
179        return _primaryKey;
180    }
181    
182    private void clearHashAndString() {
183        _hashCode = null;
184        _stringValue = null;
185    }
186    
187    @Override
188    public int hashCode() {
189        if(_hashCode == null) {
190            int hashCode = 17;
191            
192            hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0);
193            
194            hashCode = 37 * hashCode + ((contactMechanismPK != null) ? contactMechanismPK.hashCode() : 0);
195            hashCode = 37 * hashCode + ((personalTitlePK != null) ? personalTitlePK.hashCode() : 0);
196            hashCode = 37 * hashCode + ((firstName != null) ? firstName.hashCode() : 0);
197            hashCode = 37 * hashCode + ((firstNameSdx != null) ? firstNameSdx.hashCode() : 0);
198            hashCode = 37 * hashCode + ((middleName != null) ? middleName.hashCode() : 0);
199            hashCode = 37 * hashCode + ((middleNameSdx != null) ? middleNameSdx.hashCode() : 0);
200            hashCode = 37 * hashCode + ((lastName != null) ? lastName.hashCode() : 0);
201            hashCode = 37 * hashCode + ((lastNameSdx != null) ? lastNameSdx.hashCode() : 0);
202            hashCode = 37 * hashCode + ((nameSuffixPK != null) ? nameSuffixPK.hashCode() : 0);
203            hashCode = 37 * hashCode + ((companyName != null) ? companyName.hashCode() : 0);
204            hashCode = 37 * hashCode + ((attention != null) ? attention.hashCode() : 0);
205            hashCode = 37 * hashCode + ((address1 != null) ? address1.hashCode() : 0);
206            hashCode = 37 * hashCode + ((address2 != null) ? address2.hashCode() : 0);
207            hashCode = 37 * hashCode + ((address3 != null) ? address3.hashCode() : 0);
208            hashCode = 37 * hashCode + ((city != null) ? city.hashCode() : 0);
209            hashCode = 37 * hashCode + ((cityGeoCodePK != null) ? cityGeoCodePK.hashCode() : 0);
210            hashCode = 37 * hashCode + ((countyGeoCodePK != null) ? countyGeoCodePK.hashCode() : 0);
211            hashCode = 37 * hashCode + ((state != null) ? state.hashCode() : 0);
212            hashCode = 37 * hashCode + ((stateGeoCodePK != null) ? stateGeoCodePK.hashCode() : 0);
213            hashCode = 37 * hashCode + ((postalCode != null) ? postalCode.hashCode() : 0);
214            hashCode = 37 * hashCode + ((postalCodeGeoCodePK != null) ? postalCodeGeoCodePK.hashCode() : 0);
215            hashCode = 37 * hashCode + ((countryGeoCodePK != null) ? countryGeoCodePK.hashCode() : 0);
216            hashCode = 37 * hashCode + ((isCommercial != null) ? isCommercial.hashCode() : 0);
217            hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0);
218            hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0);
219            
220            _hashCode = hashCode;
221        }
222        
223        return _hashCode;
224    }
225    
226    @Override
227    @Nonnull
228    public String toString() {
229        if(_stringValue == null) {
230            _stringValue = "{" + 
231                    "entityId=" + getEntityId() +
232                    ", contactMechanismPK=" + getContactMechanismPK() +
233                    ", personalTitlePK=" + getPersonalTitlePK() +
234                    ", firstName=" + getFirstName() +
235                    ", firstNameSdx=" + getFirstNameSdx() +
236                    ", middleName=" + getMiddleName() +
237                    ", middleNameSdx=" + getMiddleNameSdx() +
238                    ", lastName=" + getLastName() +
239                    ", lastNameSdx=" + getLastNameSdx() +
240                    ", nameSuffixPK=" + getNameSuffixPK() +
241                    ", companyName=" + getCompanyName() +
242                    ", attention=" + getAttention() +
243                    ", address1=" + getAddress1() +
244                    ", address2=" + getAddress2() +
245                    ", address3=" + getAddress3() +
246                    ", city=" + getCity() +
247                    ", cityGeoCodePK=" + getCityGeoCodePK() +
248                    ", countyGeoCodePK=" + getCountyGeoCodePK() +
249                    ", state=" + getState() +
250                    ", stateGeoCodePK=" + getStateGeoCodePK() +
251                    ", postalCode=" + getPostalCode() +
252                    ", postalCodeGeoCodePK=" + getPostalCodeGeoCodePK() +
253                    ", countryGeoCodePK=" + getCountryGeoCodePK() +
254                    ", isCommercial=" + getIsCommercial() +
255                    ", fromTime=" + getFromTime() +
256                    ", thruTime=" + getThruTime() +
257                    "}";
258        }
259        return _stringValue;
260    }
261    
262    @Override
263    public boolean equals(Object other) {
264        if(this == other)
265            return true;
266        
267        if(!hasIdentity())
268            return false;
269        
270        if(other instanceof  ContactPostalAddressValue that) {
271            if(!that.hasIdentity())
272                return false;
273            
274            Long thisEntityId = getEntityId();
275            Long thatEntityId = that.getEntityId();
276            
277            boolean objectsEqual = thisEntityId.equals(thatEntityId);
278            if(objectsEqual)
279                objectsEqual = isIdentical(that);
280            
281            return objectsEqual;
282        } else {
283            return false;
284        }
285    }
286    
287    public boolean isIdentical(Object other) {
288        if(other instanceof ContactPostalAddressValue that) {
289            boolean objectsEqual = true;
290            
291            
292            if(objectsEqual) {
293                ContactMechanismPK thisContactMechanismPK = getContactMechanismPK();
294                ContactMechanismPK thatContactMechanismPK = that.getContactMechanismPK();
295                
296                if(thisContactMechanismPK == null) {
297                    objectsEqual = objectsEqual && (thatContactMechanismPK == null);
298                } else {
299                    objectsEqual = objectsEqual && thisContactMechanismPK.equals(thatContactMechanismPK);
300                }
301            }
302            
303            if(objectsEqual) {
304                PersonalTitlePK thisPersonalTitlePK = getPersonalTitlePK();
305                PersonalTitlePK thatPersonalTitlePK = that.getPersonalTitlePK();
306                
307                if(thisPersonalTitlePK == null) {
308                    objectsEqual = objectsEqual && (thatPersonalTitlePK == null);
309                } else {
310                    objectsEqual = objectsEqual && thisPersonalTitlePK.equals(thatPersonalTitlePK);
311                }
312            }
313            
314            if(objectsEqual) {
315                String thisFirstName = getFirstName();
316                String thatFirstName = that.getFirstName();
317                
318                if(thisFirstName == null) {
319                    objectsEqual = objectsEqual && (thatFirstName == null);
320                } else {
321                    objectsEqual = objectsEqual && thisFirstName.equals(thatFirstName);
322                }
323            }
324            
325            if(objectsEqual) {
326                String thisFirstNameSdx = getFirstNameSdx();
327                String thatFirstNameSdx = that.getFirstNameSdx();
328                
329                if(thisFirstNameSdx == null) {
330                    objectsEqual = objectsEqual && (thatFirstNameSdx == null);
331                } else {
332                    objectsEqual = objectsEqual && thisFirstNameSdx.equals(thatFirstNameSdx);
333                }
334            }
335            
336            if(objectsEqual) {
337                String thisMiddleName = getMiddleName();
338                String thatMiddleName = that.getMiddleName();
339                
340                if(thisMiddleName == null) {
341                    objectsEqual = objectsEqual && (thatMiddleName == null);
342                } else {
343                    objectsEqual = objectsEqual && thisMiddleName.equals(thatMiddleName);
344                }
345            }
346            
347            if(objectsEqual) {
348                String thisMiddleNameSdx = getMiddleNameSdx();
349                String thatMiddleNameSdx = that.getMiddleNameSdx();
350                
351                if(thisMiddleNameSdx == null) {
352                    objectsEqual = objectsEqual && (thatMiddleNameSdx == null);
353                } else {
354                    objectsEqual = objectsEqual && thisMiddleNameSdx.equals(thatMiddleNameSdx);
355                }
356            }
357            
358            if(objectsEqual) {
359                String thisLastName = getLastName();
360                String thatLastName = that.getLastName();
361                
362                if(thisLastName == null) {
363                    objectsEqual = objectsEqual && (thatLastName == null);
364                } else {
365                    objectsEqual = objectsEqual && thisLastName.equals(thatLastName);
366                }
367            }
368            
369            if(objectsEqual) {
370                String thisLastNameSdx = getLastNameSdx();
371                String thatLastNameSdx = that.getLastNameSdx();
372                
373                if(thisLastNameSdx == null) {
374                    objectsEqual = objectsEqual && (thatLastNameSdx == null);
375                } else {
376                    objectsEqual = objectsEqual && thisLastNameSdx.equals(thatLastNameSdx);
377                }
378            }
379            
380            if(objectsEqual) {
381                NameSuffixPK thisNameSuffixPK = getNameSuffixPK();
382                NameSuffixPK thatNameSuffixPK = that.getNameSuffixPK();
383                
384                if(thisNameSuffixPK == null) {
385                    objectsEqual = objectsEqual && (thatNameSuffixPK == null);
386                } else {
387                    objectsEqual = objectsEqual && thisNameSuffixPK.equals(thatNameSuffixPK);
388                }
389            }
390            
391            if(objectsEqual) {
392                String thisCompanyName = getCompanyName();
393                String thatCompanyName = that.getCompanyName();
394                
395                if(thisCompanyName == null) {
396                    objectsEqual = objectsEqual && (thatCompanyName == null);
397                } else {
398                    objectsEqual = objectsEqual && thisCompanyName.equals(thatCompanyName);
399                }
400            }
401            
402            if(objectsEqual) {
403                String thisAttention = getAttention();
404                String thatAttention = that.getAttention();
405                
406                if(thisAttention == null) {
407                    objectsEqual = objectsEqual && (thatAttention == null);
408                } else {
409                    objectsEqual = objectsEqual && thisAttention.equals(thatAttention);
410                }
411            }
412            
413            if(objectsEqual) {
414                String thisAddress1 = getAddress1();
415                String thatAddress1 = that.getAddress1();
416                
417                if(thisAddress1 == null) {
418                    objectsEqual = objectsEqual && (thatAddress1 == null);
419                } else {
420                    objectsEqual = objectsEqual && thisAddress1.equals(thatAddress1);
421                }
422            }
423            
424            if(objectsEqual) {
425                String thisAddress2 = getAddress2();
426                String thatAddress2 = that.getAddress2();
427                
428                if(thisAddress2 == null) {
429                    objectsEqual = objectsEqual && (thatAddress2 == null);
430                } else {
431                    objectsEqual = objectsEqual && thisAddress2.equals(thatAddress2);
432                }
433            }
434            
435            if(objectsEqual) {
436                String thisAddress3 = getAddress3();
437                String thatAddress3 = that.getAddress3();
438                
439                if(thisAddress3 == null) {
440                    objectsEqual = objectsEqual && (thatAddress3 == null);
441                } else {
442                    objectsEqual = objectsEqual && thisAddress3.equals(thatAddress3);
443                }
444            }
445            
446            if(objectsEqual) {
447                String thisCity = getCity();
448                String thatCity = that.getCity();
449                
450                if(thisCity == null) {
451                    objectsEqual = objectsEqual && (thatCity == null);
452                } else {
453                    objectsEqual = objectsEqual && thisCity.equals(thatCity);
454                }
455            }
456            
457            if(objectsEqual) {
458                GeoCodePK thisCityGeoCodePK = getCityGeoCodePK();
459                GeoCodePK thatCityGeoCodePK = that.getCityGeoCodePK();
460                
461                if(thisCityGeoCodePK == null) {
462                    objectsEqual = objectsEqual && (thatCityGeoCodePK == null);
463                } else {
464                    objectsEqual = objectsEqual && thisCityGeoCodePK.equals(thatCityGeoCodePK);
465                }
466            }
467            
468            if(objectsEqual) {
469                GeoCodePK thisCountyGeoCodePK = getCountyGeoCodePK();
470                GeoCodePK thatCountyGeoCodePK = that.getCountyGeoCodePK();
471                
472                if(thisCountyGeoCodePK == null) {
473                    objectsEqual = objectsEqual && (thatCountyGeoCodePK == null);
474                } else {
475                    objectsEqual = objectsEqual && thisCountyGeoCodePK.equals(thatCountyGeoCodePK);
476                }
477            }
478            
479            if(objectsEqual) {
480                String thisState = getState();
481                String thatState = that.getState();
482                
483                if(thisState == null) {
484                    objectsEqual = objectsEqual && (thatState == null);
485                } else {
486                    objectsEqual = objectsEqual && thisState.equals(thatState);
487                }
488            }
489            
490            if(objectsEqual) {
491                GeoCodePK thisStateGeoCodePK = getStateGeoCodePK();
492                GeoCodePK thatStateGeoCodePK = that.getStateGeoCodePK();
493                
494                if(thisStateGeoCodePK == null) {
495                    objectsEqual = objectsEqual && (thatStateGeoCodePK == null);
496                } else {
497                    objectsEqual = objectsEqual && thisStateGeoCodePK.equals(thatStateGeoCodePK);
498                }
499            }
500            
501            if(objectsEqual) {
502                String thisPostalCode = getPostalCode();
503                String thatPostalCode = that.getPostalCode();
504                
505                if(thisPostalCode == null) {
506                    objectsEqual = objectsEqual && (thatPostalCode == null);
507                } else {
508                    objectsEqual = objectsEqual && thisPostalCode.equals(thatPostalCode);
509                }
510            }
511            
512            if(objectsEqual) {
513                GeoCodePK thisPostalCodeGeoCodePK = getPostalCodeGeoCodePK();
514                GeoCodePK thatPostalCodeGeoCodePK = that.getPostalCodeGeoCodePK();
515                
516                if(thisPostalCodeGeoCodePK == null) {
517                    objectsEqual = objectsEqual && (thatPostalCodeGeoCodePK == null);
518                } else {
519                    objectsEqual = objectsEqual && thisPostalCodeGeoCodePK.equals(thatPostalCodeGeoCodePK);
520                }
521            }
522            
523            if(objectsEqual) {
524                GeoCodePK thisCountryGeoCodePK = getCountryGeoCodePK();
525                GeoCodePK thatCountryGeoCodePK = that.getCountryGeoCodePK();
526                
527                if(thisCountryGeoCodePK == null) {
528                    objectsEqual = objectsEqual && (thatCountryGeoCodePK == null);
529                } else {
530                    objectsEqual = objectsEqual && thisCountryGeoCodePK.equals(thatCountryGeoCodePK);
531                }
532            }
533            
534            if(objectsEqual) {
535                Boolean thisIsCommercial = getIsCommercial();
536                Boolean thatIsCommercial = that.getIsCommercial();
537                
538                if(thisIsCommercial == null) {
539                    objectsEqual = objectsEqual && (thatIsCommercial == null);
540                } else {
541                    objectsEqual = objectsEqual && thisIsCommercial.equals(thatIsCommercial);
542                }
543            }
544            
545            if(objectsEqual) {
546                Long thisFromTime = getFromTime();
547                Long thatFromTime = that.getFromTime();
548                
549                if(thisFromTime == null) {
550                    objectsEqual = objectsEqual && (thatFromTime == null);
551                } else {
552                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
553                }
554            }
555            
556            if(objectsEqual) {
557                Long thisThruTime = getThruTime();
558                Long thatThruTime = that.getThruTime();
559                
560                if(thisThruTime == null) {
561                    objectsEqual = objectsEqual && (thatThruTime == null);
562                } else {
563                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
564                }
565            }
566            
567            return objectsEqual;
568        } else {
569            return false;
570        }
571    }
572    
573    @Override
574    public boolean hasBeenModified() {
575        return contactMechanismPKHasBeenModified || personalTitlePKHasBeenModified || firstNameHasBeenModified || firstNameSdxHasBeenModified || middleNameHasBeenModified || middleNameSdxHasBeenModified || lastNameHasBeenModified || lastNameSdxHasBeenModified || nameSuffixPKHasBeenModified || companyNameHasBeenModified || attentionHasBeenModified || address1HasBeenModified || address2HasBeenModified || address3HasBeenModified || cityHasBeenModified || cityGeoCodePKHasBeenModified || countyGeoCodePKHasBeenModified || stateHasBeenModified || stateGeoCodePKHasBeenModified || postalCodeHasBeenModified || postalCodeGeoCodePKHasBeenModified || countryGeoCodePKHasBeenModified || isCommercialHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
576    }
577    
578    @Override
579    public void clearHasBeenModified() {
580        contactMechanismPKHasBeenModified = false;
581        personalTitlePKHasBeenModified = false;
582        firstNameHasBeenModified = false;
583        firstNameSdxHasBeenModified = false;
584        middleNameHasBeenModified = false;
585        middleNameSdxHasBeenModified = false;
586        lastNameHasBeenModified = false;
587        lastNameSdxHasBeenModified = false;
588        nameSuffixPKHasBeenModified = false;
589        companyNameHasBeenModified = false;
590        attentionHasBeenModified = false;
591        address1HasBeenModified = false;
592        address2HasBeenModified = false;
593        address3HasBeenModified = false;
594        cityHasBeenModified = false;
595        cityGeoCodePKHasBeenModified = false;
596        countyGeoCodePKHasBeenModified = false;
597        stateHasBeenModified = false;
598        stateGeoCodePKHasBeenModified = false;
599        postalCodeHasBeenModified = false;
600        postalCodeGeoCodePKHasBeenModified = false;
601        countryGeoCodePKHasBeenModified = false;
602        isCommercialHasBeenModified = false;
603        fromTimeHasBeenModified = false;
604        thruTimeHasBeenModified = false;
605    }
606    
607    @Nonnull
608    public ContactMechanismPK getContactMechanismPK() {
609        return contactMechanismPK;
610    }
611    
612    public void setContactMechanismPK(@Nonnull ContactMechanismPK contactMechanismPK)
613            throws PersistenceNotNullException {
614        checkForNull(contactMechanismPK);
615        
616        boolean update = true;
617        
618        if(this.contactMechanismPK != null) {
619            if(this.contactMechanismPK.equals(contactMechanismPK)) {
620                update = false;
621            }
622        } else if(contactMechanismPK == null) {
623            update = false;
624        }
625        
626        if(update) {
627            this.contactMechanismPK = contactMechanismPK;
628            contactMechanismPKHasBeenModified = true;
629            clearHashAndString();
630        }
631    }
632    
633    public boolean getContactMechanismPKHasBeenModified() {
634        return contactMechanismPKHasBeenModified;
635    }
636    
637    @Nullable
638    public PersonalTitlePK getPersonalTitlePK() {
639        return personalTitlePK;
640    }
641    
642    public void setPersonalTitlePK(@Nullable PersonalTitlePK personalTitlePK) {
643        boolean update = true;
644        
645        if(this.personalTitlePK != null) {
646            if(this.personalTitlePK.equals(personalTitlePK)) {
647                update = false;
648            }
649        } else if(personalTitlePK == null) {
650            update = false;
651        }
652        
653        if(update) {
654            this.personalTitlePK = personalTitlePK;
655            personalTitlePKHasBeenModified = true;
656            clearHashAndString();
657        }
658    }
659    
660    public boolean getPersonalTitlePKHasBeenModified() {
661        return personalTitlePKHasBeenModified;
662    }
663    
664    @Nullable
665    public String getFirstName() {
666        return firstName;
667    }
668    
669    public void setFirstName(@Nullable String firstName) {
670        boolean update = true;
671        
672        if(this.firstName != null) {
673            if(this.firstName.equals(firstName)) {
674                update = false;
675            }
676        } else if(firstName == null) {
677            update = false;
678        }
679        
680        if(update) {
681            this.firstName = firstName;
682            firstNameHasBeenModified = true;
683            clearHashAndString();
684        }
685    }
686    
687    public boolean getFirstNameHasBeenModified() {
688        return firstNameHasBeenModified;
689    }
690    
691    @Nullable
692    public String getFirstNameSdx() {
693        return firstNameSdx;
694    }
695    
696    public void setFirstNameSdx(@Nullable String firstNameSdx) {
697        boolean update = true;
698        
699        if(this.firstNameSdx != null) {
700            if(this.firstNameSdx.equals(firstNameSdx)) {
701                update = false;
702            }
703        } else if(firstNameSdx == null) {
704            update = false;
705        }
706        
707        if(update) {
708            this.firstNameSdx = firstNameSdx;
709            firstNameSdxHasBeenModified = true;
710            clearHashAndString();
711        }
712    }
713    
714    public boolean getFirstNameSdxHasBeenModified() {
715        return firstNameSdxHasBeenModified;
716    }
717    
718    @Nullable
719    public String getMiddleName() {
720        return middleName;
721    }
722    
723    public void setMiddleName(@Nullable String middleName) {
724        boolean update = true;
725        
726        if(this.middleName != null) {
727            if(this.middleName.equals(middleName)) {
728                update = false;
729            }
730        } else if(middleName == null) {
731            update = false;
732        }
733        
734        if(update) {
735            this.middleName = middleName;
736            middleNameHasBeenModified = true;
737            clearHashAndString();
738        }
739    }
740    
741    public boolean getMiddleNameHasBeenModified() {
742        return middleNameHasBeenModified;
743    }
744    
745    @Nullable
746    public String getMiddleNameSdx() {
747        return middleNameSdx;
748    }
749    
750    public void setMiddleNameSdx(@Nullable String middleNameSdx) {
751        boolean update = true;
752        
753        if(this.middleNameSdx != null) {
754            if(this.middleNameSdx.equals(middleNameSdx)) {
755                update = false;
756            }
757        } else if(middleNameSdx == null) {
758            update = false;
759        }
760        
761        if(update) {
762            this.middleNameSdx = middleNameSdx;
763            middleNameSdxHasBeenModified = true;
764            clearHashAndString();
765        }
766    }
767    
768    public boolean getMiddleNameSdxHasBeenModified() {
769        return middleNameSdxHasBeenModified;
770    }
771    
772    @Nullable
773    public String getLastName() {
774        return lastName;
775    }
776    
777    public void setLastName(@Nullable String lastName) {
778        boolean update = true;
779        
780        if(this.lastName != null) {
781            if(this.lastName.equals(lastName)) {
782                update = false;
783            }
784        } else if(lastName == null) {
785            update = false;
786        }
787        
788        if(update) {
789            this.lastName = lastName;
790            lastNameHasBeenModified = true;
791            clearHashAndString();
792        }
793    }
794    
795    public boolean getLastNameHasBeenModified() {
796        return lastNameHasBeenModified;
797    }
798    
799    @Nullable
800    public String getLastNameSdx() {
801        return lastNameSdx;
802    }
803    
804    public void setLastNameSdx(@Nullable String lastNameSdx) {
805        boolean update = true;
806        
807        if(this.lastNameSdx != null) {
808            if(this.lastNameSdx.equals(lastNameSdx)) {
809                update = false;
810            }
811        } else if(lastNameSdx == null) {
812            update = false;
813        }
814        
815        if(update) {
816            this.lastNameSdx = lastNameSdx;
817            lastNameSdxHasBeenModified = true;
818            clearHashAndString();
819        }
820    }
821    
822    public boolean getLastNameSdxHasBeenModified() {
823        return lastNameSdxHasBeenModified;
824    }
825    
826    @Nullable
827    public NameSuffixPK getNameSuffixPK() {
828        return nameSuffixPK;
829    }
830    
831    public void setNameSuffixPK(@Nullable NameSuffixPK nameSuffixPK) {
832        boolean update = true;
833        
834        if(this.nameSuffixPK != null) {
835            if(this.nameSuffixPK.equals(nameSuffixPK)) {
836                update = false;
837            }
838        } else if(nameSuffixPK == null) {
839            update = false;
840        }
841        
842        if(update) {
843            this.nameSuffixPK = nameSuffixPK;
844            nameSuffixPKHasBeenModified = true;
845            clearHashAndString();
846        }
847    }
848    
849    public boolean getNameSuffixPKHasBeenModified() {
850        return nameSuffixPKHasBeenModified;
851    }
852    
853    @Nullable
854    public String getCompanyName() {
855        return companyName;
856    }
857    
858    public void setCompanyName(@Nullable String companyName) {
859        boolean update = true;
860        
861        if(this.companyName != null) {
862            if(this.companyName.equals(companyName)) {
863                update = false;
864            }
865        } else if(companyName == null) {
866            update = false;
867        }
868        
869        if(update) {
870            this.companyName = companyName;
871            companyNameHasBeenModified = true;
872            clearHashAndString();
873        }
874    }
875    
876    public boolean getCompanyNameHasBeenModified() {
877        return companyNameHasBeenModified;
878    }
879    
880    @Nullable
881    public String getAttention() {
882        return attention;
883    }
884    
885    public void setAttention(@Nullable String attention) {
886        boolean update = true;
887        
888        if(this.attention != null) {
889            if(this.attention.equals(attention)) {
890                update = false;
891            }
892        } else if(attention == null) {
893            update = false;
894        }
895        
896        if(update) {
897            this.attention = attention;
898            attentionHasBeenModified = true;
899            clearHashAndString();
900        }
901    }
902    
903    public boolean getAttentionHasBeenModified() {
904        return attentionHasBeenModified;
905    }
906    
907    @Nonnull
908    public String getAddress1() {
909        return address1;
910    }
911    
912    public void setAddress1(@Nonnull String address1)
913            throws PersistenceNotNullException {
914        checkForNull(address1);
915        
916        boolean update = true;
917        
918        if(this.address1 != null) {
919            if(this.address1.equals(address1)) {
920                update = false;
921            }
922        } else if(address1 == null) {
923            update = false;
924        }
925        
926        if(update) {
927            this.address1 = address1;
928            address1HasBeenModified = true;
929            clearHashAndString();
930        }
931    }
932    
933    public boolean getAddress1HasBeenModified() {
934        return address1HasBeenModified;
935    }
936    
937    @Nullable
938    public String getAddress2() {
939        return address2;
940    }
941    
942    public void setAddress2(@Nullable String address2) {
943        boolean update = true;
944        
945        if(this.address2 != null) {
946            if(this.address2.equals(address2)) {
947                update = false;
948            }
949        } else if(address2 == null) {
950            update = false;
951        }
952        
953        if(update) {
954            this.address2 = address2;
955            address2HasBeenModified = true;
956            clearHashAndString();
957        }
958    }
959    
960    public boolean getAddress2HasBeenModified() {
961        return address2HasBeenModified;
962    }
963    
964    @Nullable
965    public String getAddress3() {
966        return address3;
967    }
968    
969    public void setAddress3(@Nullable String address3) {
970        boolean update = true;
971        
972        if(this.address3 != null) {
973            if(this.address3.equals(address3)) {
974                update = false;
975            }
976        } else if(address3 == null) {
977            update = false;
978        }
979        
980        if(update) {
981            this.address3 = address3;
982            address3HasBeenModified = true;
983            clearHashAndString();
984        }
985    }
986    
987    public boolean getAddress3HasBeenModified() {
988        return address3HasBeenModified;
989    }
990    
991    @Nullable
992    public String getCity() {
993        return city;
994    }
995    
996    public void setCity(@Nullable String city) {
997        boolean update = true;
998        
999        if(this.city != null) {
1000            if(this.city.equals(city)) {
1001                update = false;
1002            }
1003        } else if(city == null) {
1004            update = false;
1005        }
1006        
1007        if(update) {
1008            this.city = city;
1009            cityHasBeenModified = true;
1010            clearHashAndString();
1011        }
1012    }
1013    
1014    public boolean getCityHasBeenModified() {
1015        return cityHasBeenModified;
1016    }
1017    
1018    @Nullable
1019    public GeoCodePK getCityGeoCodePK() {
1020        return cityGeoCodePK;
1021    }
1022    
1023    public void setCityGeoCodePK(@Nullable GeoCodePK cityGeoCodePK) {
1024        boolean update = true;
1025        
1026        if(this.cityGeoCodePK != null) {
1027            if(this.cityGeoCodePK.equals(cityGeoCodePK)) {
1028                update = false;
1029            }
1030        } else if(cityGeoCodePK == null) {
1031            update = false;
1032        }
1033        
1034        if(update) {
1035            this.cityGeoCodePK = cityGeoCodePK;
1036            cityGeoCodePKHasBeenModified = true;
1037            clearHashAndString();
1038        }
1039    }
1040    
1041    public boolean getCityGeoCodePKHasBeenModified() {
1042        return cityGeoCodePKHasBeenModified;
1043    }
1044    
1045    @Nullable
1046    public GeoCodePK getCountyGeoCodePK() {
1047        return countyGeoCodePK;
1048    }
1049    
1050    public void setCountyGeoCodePK(@Nullable GeoCodePK countyGeoCodePK) {
1051        boolean update = true;
1052        
1053        if(this.countyGeoCodePK != null) {
1054            if(this.countyGeoCodePK.equals(countyGeoCodePK)) {
1055                update = false;
1056            }
1057        } else if(countyGeoCodePK == null) {
1058            update = false;
1059        }
1060        
1061        if(update) {
1062            this.countyGeoCodePK = countyGeoCodePK;
1063            countyGeoCodePKHasBeenModified = true;
1064            clearHashAndString();
1065        }
1066    }
1067    
1068    public boolean getCountyGeoCodePKHasBeenModified() {
1069        return countyGeoCodePKHasBeenModified;
1070    }
1071    
1072    @Nullable
1073    public String getState() {
1074        return state;
1075    }
1076    
1077    public void setState(@Nullable String state) {
1078        boolean update = true;
1079        
1080        if(this.state != null) {
1081            if(this.state.equals(state)) {
1082                update = false;
1083            }
1084        } else if(state == null) {
1085            update = false;
1086        }
1087        
1088        if(update) {
1089            this.state = state;
1090            stateHasBeenModified = true;
1091            clearHashAndString();
1092        }
1093    }
1094    
1095    public boolean getStateHasBeenModified() {
1096        return stateHasBeenModified;
1097    }
1098    
1099    @Nullable
1100    public GeoCodePK getStateGeoCodePK() {
1101        return stateGeoCodePK;
1102    }
1103    
1104    public void setStateGeoCodePK(@Nullable GeoCodePK stateGeoCodePK) {
1105        boolean update = true;
1106        
1107        if(this.stateGeoCodePK != null) {
1108            if(this.stateGeoCodePK.equals(stateGeoCodePK)) {
1109                update = false;
1110            }
1111        } else if(stateGeoCodePK == null) {
1112            update = false;
1113        }
1114        
1115        if(update) {
1116            this.stateGeoCodePK = stateGeoCodePK;
1117            stateGeoCodePKHasBeenModified = true;
1118            clearHashAndString();
1119        }
1120    }
1121    
1122    public boolean getStateGeoCodePKHasBeenModified() {
1123        return stateGeoCodePKHasBeenModified;
1124    }
1125    
1126    @Nullable
1127    public String getPostalCode() {
1128        return postalCode;
1129    }
1130    
1131    public void setPostalCode(@Nullable String postalCode) {
1132        boolean update = true;
1133        
1134        if(this.postalCode != null) {
1135            if(this.postalCode.equals(postalCode)) {
1136                update = false;
1137            }
1138        } else if(postalCode == null) {
1139            update = false;
1140        }
1141        
1142        if(update) {
1143            this.postalCode = postalCode;
1144            postalCodeHasBeenModified = true;
1145            clearHashAndString();
1146        }
1147    }
1148    
1149    public boolean getPostalCodeHasBeenModified() {
1150        return postalCodeHasBeenModified;
1151    }
1152    
1153    @Nullable
1154    public GeoCodePK getPostalCodeGeoCodePK() {
1155        return postalCodeGeoCodePK;
1156    }
1157    
1158    public void setPostalCodeGeoCodePK(@Nullable GeoCodePK postalCodeGeoCodePK) {
1159        boolean update = true;
1160        
1161        if(this.postalCodeGeoCodePK != null) {
1162            if(this.postalCodeGeoCodePK.equals(postalCodeGeoCodePK)) {
1163                update = false;
1164            }
1165        } else if(postalCodeGeoCodePK == null) {
1166            update = false;
1167        }
1168        
1169        if(update) {
1170            this.postalCodeGeoCodePK = postalCodeGeoCodePK;
1171            postalCodeGeoCodePKHasBeenModified = true;
1172            clearHashAndString();
1173        }
1174    }
1175    
1176    public boolean getPostalCodeGeoCodePKHasBeenModified() {
1177        return postalCodeGeoCodePKHasBeenModified;
1178    }
1179    
1180    @Nonnull
1181    public GeoCodePK getCountryGeoCodePK() {
1182        return countryGeoCodePK;
1183    }
1184    
1185    public void setCountryGeoCodePK(@Nonnull GeoCodePK countryGeoCodePK)
1186            throws PersistenceNotNullException {
1187        checkForNull(countryGeoCodePK);
1188        
1189        boolean update = true;
1190        
1191        if(this.countryGeoCodePK != null) {
1192            if(this.countryGeoCodePK.equals(countryGeoCodePK)) {
1193                update = false;
1194            }
1195        } else if(countryGeoCodePK == null) {
1196            update = false;
1197        }
1198        
1199        if(update) {
1200            this.countryGeoCodePK = countryGeoCodePK;
1201            countryGeoCodePKHasBeenModified = true;
1202            clearHashAndString();
1203        }
1204    }
1205    
1206    public boolean getCountryGeoCodePKHasBeenModified() {
1207        return countryGeoCodePKHasBeenModified;
1208    }
1209    
1210    @Nonnull
1211    public Boolean getIsCommercial() {
1212        return isCommercial;
1213    }
1214    
1215    public void setIsCommercial(@Nonnull Boolean isCommercial)
1216            throws PersistenceNotNullException {
1217        checkForNull(isCommercial);
1218        
1219        boolean update = true;
1220        
1221        if(this.isCommercial != null) {
1222            if(this.isCommercial.equals(isCommercial)) {
1223                update = false;
1224            }
1225        } else if(isCommercial == null) {
1226            update = false;
1227        }
1228        
1229        if(update) {
1230            this.isCommercial = isCommercial;
1231            isCommercialHasBeenModified = true;
1232            clearHashAndString();
1233        }
1234    }
1235    
1236    public boolean getIsCommercialHasBeenModified() {
1237        return isCommercialHasBeenModified;
1238    }
1239    
1240    @Nonnull
1241    public Long getFromTime() {
1242        return fromTime;
1243    }
1244    
1245    public void setFromTime(@Nonnull Long fromTime)
1246            throws PersistenceNotNullException {
1247        checkForNull(fromTime);
1248        
1249        boolean update = true;
1250        
1251        if(this.fromTime != null) {
1252            if(this.fromTime.equals(fromTime)) {
1253                update = false;
1254            }
1255        } else if(fromTime == null) {
1256            update = false;
1257        }
1258        
1259        if(update) {
1260            this.fromTime = fromTime;
1261            fromTimeHasBeenModified = true;
1262            clearHashAndString();
1263        }
1264    }
1265    
1266    public boolean getFromTimeHasBeenModified() {
1267        return fromTimeHasBeenModified;
1268    }
1269    
1270    @Nonnull
1271    public Long getThruTime() {
1272        return thruTime;
1273    }
1274    
1275    public void setThruTime(@Nonnull Long thruTime)
1276            throws PersistenceNotNullException {
1277        checkForNull(thruTime);
1278        
1279        boolean update = true;
1280        
1281        if(this.thruTime != null) {
1282            if(this.thruTime.equals(thruTime)) {
1283                update = false;
1284            }
1285        } else if(thruTime == null) {
1286            update = false;
1287        }
1288        
1289        if(update) {
1290            this.thruTime = thruTime;
1291            thruTimeHasBeenModified = true;
1292            clearHashAndString();
1293        }
1294    }
1295    
1296    public boolean getThruTimeHasBeenModified() {
1297        return thruTimeHasBeenModified;
1298    }
1299    
1300}