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 * ContactListDetailValue.java
021 */
022
023package com.echothree.model.data.contactlist.server.value;
024
025import com.echothree.model.data.contactlist.common.pk.ContactListDetailPK;
026
027import com.echothree.model.data.contactlist.server.factory.ContactListDetailFactory;
028
029import com.echothree.model.data.contactlist.common.pk.ContactListPK;
030import com.echothree.model.data.contactlist.common.pk.ContactListGroupPK;
031import com.echothree.model.data.contactlist.common.pk.ContactListTypePK;
032import com.echothree.model.data.contactlist.common.pk.ContactListFrequencyPK;
033import com.echothree.model.data.workflow.common.pk.WorkflowEntrancePK;
034
035import com.echothree.util.common.exception.PersistenceCloneException;
036import com.echothree.util.common.exception.PersistenceNotNullException;
037
038import com.echothree.util.server.persistence.BaseValue;
039
040import java.io.Serializable;
041
042import javax.annotation.Nonnull;
043import javax.annotation.Nullable;
044
045public class ContactListDetailValue
046        extends BaseValue<ContactListDetailPK>
047        implements Cloneable, Serializable {
048    
049    private ContactListPK contactListPK;
050    private boolean contactListPKHasBeenModified = false;
051    private String contactListName;
052    private boolean contactListNameHasBeenModified = false;
053    private ContactListGroupPK contactListGroupPK;
054    private boolean contactListGroupPKHasBeenModified = false;
055    private ContactListTypePK contactListTypePK;
056    private boolean contactListTypePKHasBeenModified = false;
057    private ContactListFrequencyPK contactListFrequencyPK;
058    private boolean contactListFrequencyPKHasBeenModified = false;
059    private WorkflowEntrancePK defaultPartyContactListStatusPK;
060    private boolean defaultPartyContactListStatusPKHasBeenModified = false;
061    private Boolean isDefault;
062    private boolean isDefaultHasBeenModified = false;
063    private Integer sortOrder;
064    private boolean sortOrderHasBeenModified = false;
065    private Long fromTime;
066    private boolean fromTimeHasBeenModified = false;
067    private Long thruTime;
068    private boolean thruTimeHasBeenModified = false;
069    
070    private transient Integer _hashCode = null;
071    private transient String _stringValue = null;
072    
073    private void constructFields(ContactListPK contactListPK, String contactListName, ContactListGroupPK contactListGroupPK, ContactListTypePK contactListTypePK, ContactListFrequencyPK contactListFrequencyPK, WorkflowEntrancePK defaultPartyContactListStatusPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime)
074            throws PersistenceNotNullException {
075        checkForNull(contactListPK);
076        this.contactListPK = contactListPK;
077        checkForNull(contactListName);
078        this.contactListName = contactListName;
079        checkForNull(contactListGroupPK);
080        this.contactListGroupPK = contactListGroupPK;
081        checkForNull(contactListTypePK);
082        this.contactListTypePK = contactListTypePK;
083        this.contactListFrequencyPK = contactListFrequencyPK;
084        checkForNull(defaultPartyContactListStatusPK);
085        this.defaultPartyContactListStatusPK = defaultPartyContactListStatusPK;
086        checkForNull(isDefault);
087        this.isDefault = isDefault;
088        checkForNull(sortOrder);
089        this.sortOrder = sortOrder;
090        checkForNull(fromTime);
091        this.fromTime = fromTime;
092        checkForNull(thruTime);
093        this.thruTime = thruTime;
094    }
095    
096    /** Creates a new instance of ContactListDetailValue */
097    public ContactListDetailValue(ContactListDetailPK contactListDetailPK, ContactListPK contactListPK, String contactListName, ContactListGroupPK contactListGroupPK, ContactListTypePK contactListTypePK, ContactListFrequencyPK contactListFrequencyPK, WorkflowEntrancePK defaultPartyContactListStatusPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime)
098            throws PersistenceNotNullException {
099        super(contactListDetailPK);
100        constructFields(contactListPK, contactListName, contactListGroupPK, contactListTypePK, contactListFrequencyPK, defaultPartyContactListStatusPK, isDefault, sortOrder, fromTime, thruTime);
101    }
102    
103    /** Creates a new instance of ContactListDetailValue */
104    public ContactListDetailValue(ContactListPK contactListPK, String contactListName, ContactListGroupPK contactListGroupPK, ContactListTypePK contactListTypePK, ContactListFrequencyPK contactListFrequencyPK, WorkflowEntrancePK defaultPartyContactListStatusPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime)
105            throws PersistenceNotNullException {
106        super();
107        constructFields(contactListPK, contactListName, contactListGroupPK, contactListTypePK, contactListFrequencyPK, defaultPartyContactListStatusPK, isDefault, sortOrder, fromTime, thruTime);
108    }
109    
110    @Override
111    @Nonnull
112    public ContactListDetailFactory getBaseFactoryInstance() {
113        return ContactListDetailFactory.getInstance();
114    }
115    
116    @Override
117    @Nonnull
118    public ContactListDetailValue clone() {
119        Object result;
120        
121        try {
122            result = super.clone();
123        } catch (CloneNotSupportedException cnse) {
124            // This shouldn't happen, fail when it does.
125            throw new PersistenceCloneException(cnse);
126        }
127        
128        return (ContactListDetailValue)result;
129    }
130    
131    @Override
132    @Nonnull
133    public ContactListDetailPK getPrimaryKey() {
134        if(_primaryKey == null) {
135            _primaryKey = new ContactListDetailPK(entityId);
136        }
137        
138        return _primaryKey;
139    }
140    
141    private void clearHashAndString() {
142        _hashCode = null;
143        _stringValue = null;
144    }
145    
146    @Override
147    public int hashCode() {
148        if(_hashCode == null) {
149            int hashCode = 17;
150            
151            hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0);
152            
153            hashCode = 37 * hashCode + ((contactListPK != null) ? contactListPK.hashCode() : 0);
154            hashCode = 37 * hashCode + ((contactListName != null) ? contactListName.hashCode() : 0);
155            hashCode = 37 * hashCode + ((contactListGroupPK != null) ? contactListGroupPK.hashCode() : 0);
156            hashCode = 37 * hashCode + ((contactListTypePK != null) ? contactListTypePK.hashCode() : 0);
157            hashCode = 37 * hashCode + ((contactListFrequencyPK != null) ? contactListFrequencyPK.hashCode() : 0);
158            hashCode = 37 * hashCode + ((defaultPartyContactListStatusPK != null) ? defaultPartyContactListStatusPK.hashCode() : 0);
159            hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0);
160            hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.hashCode() : 0);
161            hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0);
162            hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0);
163            
164            _hashCode = hashCode;
165        }
166        
167        return _hashCode;
168    }
169    
170    @Override
171    @Nonnull
172    public String toString() {
173        if(_stringValue == null) {
174            _stringValue = "{" + 
175                    "entityId=" + getEntityId() +
176                    ", contactListPK=" + getContactListPK() +
177                    ", contactListName=" + getContactListName() +
178                    ", contactListGroupPK=" + getContactListGroupPK() +
179                    ", contactListTypePK=" + getContactListTypePK() +
180                    ", contactListFrequencyPK=" + getContactListFrequencyPK() +
181                    ", defaultPartyContactListStatusPK=" + getDefaultPartyContactListStatusPK() +
182                    ", isDefault=" + getIsDefault() +
183                    ", sortOrder=" + getSortOrder() +
184                    ", fromTime=" + getFromTime() +
185                    ", thruTime=" + getThruTime() +
186                    "}";
187        }
188        return _stringValue;
189    }
190    
191    @Override
192    public boolean equals(Object other) {
193        if(this == other)
194            return true;
195        
196        if(!hasIdentity())
197            return false;
198        
199        if(other instanceof  ContactListDetailValue that) {
200            if(!that.hasIdentity())
201                return false;
202            
203            Long thisEntityId = getEntityId();
204            Long thatEntityId = that.getEntityId();
205            
206            boolean objectsEqual = thisEntityId.equals(thatEntityId);
207            if(objectsEqual)
208                objectsEqual = isIdentical(that);
209            
210            return objectsEqual;
211        } else {
212            return false;
213        }
214    }
215    
216    public boolean isIdentical(Object other) {
217        if(other instanceof ContactListDetailValue that) {
218            boolean objectsEqual = true;
219            
220            
221            if(objectsEqual) {
222                ContactListPK thisContactListPK = getContactListPK();
223                ContactListPK thatContactListPK = that.getContactListPK();
224                
225                if(thisContactListPK == null) {
226                    objectsEqual = objectsEqual && (thatContactListPK == null);
227                } else {
228                    objectsEqual = objectsEqual && thisContactListPK.equals(thatContactListPK);
229                }
230            }
231            
232            if(objectsEqual) {
233                String thisContactListName = getContactListName();
234                String thatContactListName = that.getContactListName();
235                
236                if(thisContactListName == null) {
237                    objectsEqual = objectsEqual && (thatContactListName == null);
238                } else {
239                    objectsEqual = objectsEqual && thisContactListName.equals(thatContactListName);
240                }
241            }
242            
243            if(objectsEqual) {
244                ContactListGroupPK thisContactListGroupPK = getContactListGroupPK();
245                ContactListGroupPK thatContactListGroupPK = that.getContactListGroupPK();
246                
247                if(thisContactListGroupPK == null) {
248                    objectsEqual = objectsEqual && (thatContactListGroupPK == null);
249                } else {
250                    objectsEqual = objectsEqual && thisContactListGroupPK.equals(thatContactListGroupPK);
251                }
252            }
253            
254            if(objectsEqual) {
255                ContactListTypePK thisContactListTypePK = getContactListTypePK();
256                ContactListTypePK thatContactListTypePK = that.getContactListTypePK();
257                
258                if(thisContactListTypePK == null) {
259                    objectsEqual = objectsEqual && (thatContactListTypePK == null);
260                } else {
261                    objectsEqual = objectsEqual && thisContactListTypePK.equals(thatContactListTypePK);
262                }
263            }
264            
265            if(objectsEqual) {
266                ContactListFrequencyPK thisContactListFrequencyPK = getContactListFrequencyPK();
267                ContactListFrequencyPK thatContactListFrequencyPK = that.getContactListFrequencyPK();
268                
269                if(thisContactListFrequencyPK == null) {
270                    objectsEqual = objectsEqual && (thatContactListFrequencyPK == null);
271                } else {
272                    objectsEqual = objectsEqual && thisContactListFrequencyPK.equals(thatContactListFrequencyPK);
273                }
274            }
275            
276            if(objectsEqual) {
277                WorkflowEntrancePK thisDefaultPartyContactListStatusPK = getDefaultPartyContactListStatusPK();
278                WorkflowEntrancePK thatDefaultPartyContactListStatusPK = that.getDefaultPartyContactListStatusPK();
279                
280                if(thisDefaultPartyContactListStatusPK == null) {
281                    objectsEqual = objectsEqual && (thatDefaultPartyContactListStatusPK == null);
282                } else {
283                    objectsEqual = objectsEqual && thisDefaultPartyContactListStatusPK.equals(thatDefaultPartyContactListStatusPK);
284                }
285            }
286            
287            if(objectsEqual) {
288                Boolean thisIsDefault = getIsDefault();
289                Boolean thatIsDefault = that.getIsDefault();
290                
291                if(thisIsDefault == null) {
292                    objectsEqual = objectsEqual && (thatIsDefault == null);
293                } else {
294                    objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault);
295                }
296            }
297            
298            if(objectsEqual) {
299                Integer thisSortOrder = getSortOrder();
300                Integer thatSortOrder = that.getSortOrder();
301                
302                if(thisSortOrder == null) {
303                    objectsEqual = objectsEqual && (thatSortOrder == null);
304                } else {
305                    objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder);
306                }
307            }
308            
309            if(objectsEqual) {
310                Long thisFromTime = getFromTime();
311                Long thatFromTime = that.getFromTime();
312                
313                if(thisFromTime == null) {
314                    objectsEqual = objectsEqual && (thatFromTime == null);
315                } else {
316                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
317                }
318            }
319            
320            if(objectsEqual) {
321                Long thisThruTime = getThruTime();
322                Long thatThruTime = that.getThruTime();
323                
324                if(thisThruTime == null) {
325                    objectsEqual = objectsEqual && (thatThruTime == null);
326                } else {
327                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
328                }
329            }
330            
331            return objectsEqual;
332        } else {
333            return false;
334        }
335    }
336    
337    @Override
338    public boolean hasBeenModified() {
339        return contactListPKHasBeenModified || contactListNameHasBeenModified || contactListGroupPKHasBeenModified || contactListTypePKHasBeenModified || contactListFrequencyPKHasBeenModified || defaultPartyContactListStatusPKHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
340    }
341    
342    @Override
343    public void clearHasBeenModified() {
344        contactListPKHasBeenModified = false;
345        contactListNameHasBeenModified = false;
346        contactListGroupPKHasBeenModified = false;
347        contactListTypePKHasBeenModified = false;
348        contactListFrequencyPKHasBeenModified = false;
349        defaultPartyContactListStatusPKHasBeenModified = false;
350        isDefaultHasBeenModified = false;
351        sortOrderHasBeenModified = false;
352        fromTimeHasBeenModified = false;
353        thruTimeHasBeenModified = false;
354    }
355    
356    @Nonnull
357    public ContactListPK getContactListPK() {
358        return contactListPK;
359    }
360    
361    public void setContactListPK(@Nonnull ContactListPK contactListPK)
362            throws PersistenceNotNullException {
363        checkForNull(contactListPK);
364        
365        boolean update = true;
366        
367        if(this.contactListPK != null) {
368            if(this.contactListPK.equals(contactListPK)) {
369                update = false;
370            }
371        } else if(contactListPK == null) {
372            update = false;
373        }
374        
375        if(update) {
376            this.contactListPK = contactListPK;
377            contactListPKHasBeenModified = true;
378            clearHashAndString();
379        }
380    }
381    
382    public boolean getContactListPKHasBeenModified() {
383        return contactListPKHasBeenModified;
384    }
385    
386    @Nonnull
387    public String getContactListName() {
388        return contactListName;
389    }
390    
391    public void setContactListName(@Nonnull String contactListName)
392            throws PersistenceNotNullException {
393        checkForNull(contactListName);
394        
395        boolean update = true;
396        
397        if(this.contactListName != null) {
398            if(this.contactListName.equals(contactListName)) {
399                update = false;
400            }
401        } else if(contactListName == null) {
402            update = false;
403        }
404        
405        if(update) {
406            this.contactListName = contactListName;
407            contactListNameHasBeenModified = true;
408            clearHashAndString();
409        }
410    }
411    
412    public boolean getContactListNameHasBeenModified() {
413        return contactListNameHasBeenModified;
414    }
415    
416    @Nonnull
417    public ContactListGroupPK getContactListGroupPK() {
418        return contactListGroupPK;
419    }
420    
421    public void setContactListGroupPK(@Nonnull ContactListGroupPK contactListGroupPK)
422            throws PersistenceNotNullException {
423        checkForNull(contactListGroupPK);
424        
425        boolean update = true;
426        
427        if(this.contactListGroupPK != null) {
428            if(this.contactListGroupPK.equals(contactListGroupPK)) {
429                update = false;
430            }
431        } else if(contactListGroupPK == null) {
432            update = false;
433        }
434        
435        if(update) {
436            this.contactListGroupPK = contactListGroupPK;
437            contactListGroupPKHasBeenModified = true;
438            clearHashAndString();
439        }
440    }
441    
442    public boolean getContactListGroupPKHasBeenModified() {
443        return contactListGroupPKHasBeenModified;
444    }
445    
446    @Nonnull
447    public ContactListTypePK getContactListTypePK() {
448        return contactListTypePK;
449    }
450    
451    public void setContactListTypePK(@Nonnull ContactListTypePK contactListTypePK)
452            throws PersistenceNotNullException {
453        checkForNull(contactListTypePK);
454        
455        boolean update = true;
456        
457        if(this.contactListTypePK != null) {
458            if(this.contactListTypePK.equals(contactListTypePK)) {
459                update = false;
460            }
461        } else if(contactListTypePK == null) {
462            update = false;
463        }
464        
465        if(update) {
466            this.contactListTypePK = contactListTypePK;
467            contactListTypePKHasBeenModified = true;
468            clearHashAndString();
469        }
470    }
471    
472    public boolean getContactListTypePKHasBeenModified() {
473        return contactListTypePKHasBeenModified;
474    }
475    
476    @Nullable
477    public ContactListFrequencyPK getContactListFrequencyPK() {
478        return contactListFrequencyPK;
479    }
480    
481    public void setContactListFrequencyPK(@Nullable ContactListFrequencyPK contactListFrequencyPK) {
482        boolean update = true;
483        
484        if(this.contactListFrequencyPK != null) {
485            if(this.contactListFrequencyPK.equals(contactListFrequencyPK)) {
486                update = false;
487            }
488        } else if(contactListFrequencyPK == null) {
489            update = false;
490        }
491        
492        if(update) {
493            this.contactListFrequencyPK = contactListFrequencyPK;
494            contactListFrequencyPKHasBeenModified = true;
495            clearHashAndString();
496        }
497    }
498    
499    public boolean getContactListFrequencyPKHasBeenModified() {
500        return contactListFrequencyPKHasBeenModified;
501    }
502    
503    @Nonnull
504    public WorkflowEntrancePK getDefaultPartyContactListStatusPK() {
505        return defaultPartyContactListStatusPK;
506    }
507    
508    public void setDefaultPartyContactListStatusPK(@Nonnull WorkflowEntrancePK defaultPartyContactListStatusPK)
509            throws PersistenceNotNullException {
510        checkForNull(defaultPartyContactListStatusPK);
511        
512        boolean update = true;
513        
514        if(this.defaultPartyContactListStatusPK != null) {
515            if(this.defaultPartyContactListStatusPK.equals(defaultPartyContactListStatusPK)) {
516                update = false;
517            }
518        } else if(defaultPartyContactListStatusPK == null) {
519            update = false;
520        }
521        
522        if(update) {
523            this.defaultPartyContactListStatusPK = defaultPartyContactListStatusPK;
524            defaultPartyContactListStatusPKHasBeenModified = true;
525            clearHashAndString();
526        }
527    }
528    
529    public boolean getDefaultPartyContactListStatusPKHasBeenModified() {
530        return defaultPartyContactListStatusPKHasBeenModified;
531    }
532    
533    @Nonnull
534    public Boolean getIsDefault() {
535        return isDefault;
536    }
537    
538    public void setIsDefault(@Nonnull Boolean isDefault)
539            throws PersistenceNotNullException {
540        checkForNull(isDefault);
541        
542        boolean update = true;
543        
544        if(this.isDefault != null) {
545            if(this.isDefault.equals(isDefault)) {
546                update = false;
547            }
548        } else if(isDefault == null) {
549            update = false;
550        }
551        
552        if(update) {
553            this.isDefault = isDefault;
554            isDefaultHasBeenModified = true;
555            clearHashAndString();
556        }
557    }
558    
559    public boolean getIsDefaultHasBeenModified() {
560        return isDefaultHasBeenModified;
561    }
562    
563    @Nonnull
564    public Integer getSortOrder() {
565        return sortOrder;
566    }
567    
568    public void setSortOrder(@Nonnull Integer sortOrder)
569            throws PersistenceNotNullException {
570        checkForNull(sortOrder);
571        
572        boolean update = true;
573        
574        if(this.sortOrder != null) {
575            if(this.sortOrder.equals(sortOrder)) {
576                update = false;
577            }
578        } else if(sortOrder == null) {
579            update = false;
580        }
581        
582        if(update) {
583            this.sortOrder = sortOrder;
584            sortOrderHasBeenModified = true;
585            clearHashAndString();
586        }
587    }
588    
589    public boolean getSortOrderHasBeenModified() {
590        return sortOrderHasBeenModified;
591    }
592    
593    @Nonnull
594    public Long getFromTime() {
595        return fromTime;
596    }
597    
598    public void setFromTime(@Nonnull Long fromTime)
599            throws PersistenceNotNullException {
600        checkForNull(fromTime);
601        
602        boolean update = true;
603        
604        if(this.fromTime != null) {
605            if(this.fromTime.equals(fromTime)) {
606                update = false;
607            }
608        } else if(fromTime == null) {
609            update = false;
610        }
611        
612        if(update) {
613            this.fromTime = fromTime;
614            fromTimeHasBeenModified = true;
615            clearHashAndString();
616        }
617    }
618    
619    public boolean getFromTimeHasBeenModified() {
620        return fromTimeHasBeenModified;
621    }
622    
623    @Nonnull
624    public Long getThruTime() {
625        return thruTime;
626    }
627    
628    public void setThruTime(@Nonnull Long thruTime)
629            throws PersistenceNotNullException {
630        checkForNull(thruTime);
631        
632        boolean update = true;
633        
634        if(this.thruTime != null) {
635            if(this.thruTime.equals(thruTime)) {
636                update = false;
637            }
638        } else if(thruTime == null) {
639            update = false;
640        }
641        
642        if(update) {
643            this.thruTime = thruTime;
644            thruTimeHasBeenModified = true;
645            clearHashAndString();
646        }
647    }
648    
649    public boolean getThruTimeHasBeenModified() {
650        return thruTimeHasBeenModified;
651    }
652    
653}