001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 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 * PartyApplicationEditorUseDetailValue.java
021 */
022
023package com.echothree.model.data.party.server.value;
024
025import com.echothree.model.data.party.common.pk.PartyApplicationEditorUseDetailPK;
026
027import com.echothree.model.data.party.server.factory.PartyApplicationEditorUseDetailFactory;
028
029import com.echothree.model.data.party.common.pk.PartyApplicationEditorUsePK;
030import com.echothree.model.data.party.common.pk.PartyPK;
031import com.echothree.model.data.core.common.pk.ApplicationEditorUsePK;
032import com.echothree.model.data.core.common.pk.ApplicationEditorPK;
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
041public class PartyApplicationEditorUseDetailValue
042        extends BaseValue<PartyApplicationEditorUseDetailPK>
043        implements Cloneable, Serializable {
044    
045    private PartyApplicationEditorUsePK partyApplicationEditorUsePK;
046    private boolean partyApplicationEditorUsePKHasBeenModified = false;
047    private PartyPK partyPK;
048    private boolean partyPKHasBeenModified = false;
049    private ApplicationEditorUsePK applicationEditorUsePK;
050    private boolean applicationEditorUsePKHasBeenModified = false;
051    private ApplicationEditorPK applicationEditorPK;
052    private boolean applicationEditorPKHasBeenModified = false;
053    private Integer preferredHeight;
054    private boolean preferredHeightHasBeenModified = false;
055    private Integer preferredWidth;
056    private boolean preferredWidthHasBeenModified = false;
057    private Long fromTime;
058    private boolean fromTimeHasBeenModified = false;
059    private Long thruTime;
060    private boolean thruTimeHasBeenModified = false;
061    
062    private transient Integer _hashCode = null;
063    private transient String _stringValue = null;
064    
065    private void constructFields(PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime)
066            throws PersistenceNotNullException {
067        checkForNull(partyApplicationEditorUsePK);
068        this.partyApplicationEditorUsePK = partyApplicationEditorUsePK;
069        checkForNull(partyPK);
070        this.partyPK = partyPK;
071        checkForNull(applicationEditorUsePK);
072        this.applicationEditorUsePK = applicationEditorUsePK;
073        this.applicationEditorPK = applicationEditorPK;
074        this.preferredHeight = preferredHeight;
075        this.preferredWidth = preferredWidth;
076        checkForNull(fromTime);
077        this.fromTime = fromTime;
078        checkForNull(thruTime);
079        this.thruTime = thruTime;
080    }
081    
082    /** Creates a new instance of PartyApplicationEditorUseDetailValue */
083    public PartyApplicationEditorUseDetailValue(PartyApplicationEditorUseDetailPK partyApplicationEditorUseDetailPK, PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime)
084            throws PersistenceNotNullException {
085        super(partyApplicationEditorUseDetailPK);
086        constructFields(partyApplicationEditorUsePK, partyPK, applicationEditorUsePK, applicationEditorPK, preferredHeight, preferredWidth, fromTime, thruTime);
087    }
088    
089    /** Creates a new instance of PartyApplicationEditorUseDetailValue */
090    public PartyApplicationEditorUseDetailValue(PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime)
091            throws PersistenceNotNullException {
092        super();
093        constructFields(partyApplicationEditorUsePK, partyPK, applicationEditorUsePK, applicationEditorPK, preferredHeight, preferredWidth, fromTime, thruTime);
094    }
095    
096   @Override
097   public PartyApplicationEditorUseDetailFactory getBaseFactoryInstance() {
098        return PartyApplicationEditorUseDetailFactory.getInstance();
099    }
100    
101    @Override
102    public PartyApplicationEditorUseDetailValue clone() {
103        Object result;
104        
105        try {
106            result = super.clone();
107        } catch (CloneNotSupportedException cnse) {
108            // This shouldn't happen, fail when it does.
109            throw new PersistenceCloneException(cnse);
110        }
111        
112        return (PartyApplicationEditorUseDetailValue)result;
113    }
114    
115   @Override
116    public PartyApplicationEditorUseDetailPK getPrimaryKey() {
117        if(_primaryKey == null) {
118            _primaryKey = new PartyApplicationEditorUseDetailPK(entityId);
119        }
120        
121        return _primaryKey;
122    }
123    
124    private void clearHashAndString() {
125        _hashCode = null;
126        _stringValue = null;
127    }
128    
129    @Override
130    public int hashCode() {
131        if(_hashCode == null) {
132            int hashCode = 17;
133            
134            hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0);
135            
136            hashCode = 37 * hashCode + ((partyApplicationEditorUsePK != null) ? partyApplicationEditorUsePK.hashCode() : 0);
137            hashCode = 37 * hashCode + ((partyPK != null) ? partyPK.hashCode() : 0);
138            hashCode = 37 * hashCode + ((applicationEditorUsePK != null) ? applicationEditorUsePK.hashCode() : 0);
139            hashCode = 37 * hashCode + ((applicationEditorPK != null) ? applicationEditorPK.hashCode() : 0);
140            hashCode = 37 * hashCode + ((preferredHeight != null) ? preferredHeight.hashCode() : 0);
141            hashCode = 37 * hashCode + ((preferredWidth != null) ? preferredWidth.hashCode() : 0);
142            hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0);
143            hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0);
144            
145            _hashCode = hashCode;
146        }
147        
148        return _hashCode;
149    }
150    
151    @Override
152    public String toString() {
153        if(_stringValue == null) {
154            _stringValue = "{" + 
155                    "entityId=" + getEntityId() +
156                    ", partyApplicationEditorUsePK=" + getPartyApplicationEditorUsePK() +
157                    ", partyPK=" + getPartyPK() +
158                    ", applicationEditorUsePK=" + getApplicationEditorUsePK() +
159                    ", applicationEditorPK=" + getApplicationEditorPK() +
160                    ", preferredHeight=" + getPreferredHeight() +
161                    ", preferredWidth=" + getPreferredWidth() +
162                    ", fromTime=" + getFromTime() +
163                    ", thruTime=" + getThruTime() +
164                    "}";
165        }
166        return _stringValue;
167    }
168    
169    @Override
170    public boolean equals(Object other) {
171        if(this == other)
172            return true;
173        
174        if(!hasIdentity())
175            return false;
176        
177        if(other instanceof  PartyApplicationEditorUseDetailValue that) {
178            if(!that.hasIdentity())
179                return false;
180            
181            Long thisEntityId = getEntityId();
182            Long thatEntityId = that.getEntityId();
183            
184            boolean objectsEqual = thisEntityId.equals(thatEntityId);
185            if(objectsEqual)
186                objectsEqual = isIdentical(that);
187            
188            return objectsEqual;
189        } else {
190            return false;
191        }
192    }
193    
194    public boolean isIdentical(Object other) {
195        if(other instanceof PartyApplicationEditorUseDetailValue that) {
196            boolean objectsEqual = true;
197            
198            
199            if(objectsEqual) {
200                PartyApplicationEditorUsePK thisPartyApplicationEditorUsePK = getPartyApplicationEditorUsePK();
201                PartyApplicationEditorUsePK thatPartyApplicationEditorUsePK = that.getPartyApplicationEditorUsePK();
202                
203                if(thisPartyApplicationEditorUsePK == null) {
204                    objectsEqual = objectsEqual && (thatPartyApplicationEditorUsePK == null);
205                } else {
206                    objectsEqual = objectsEqual && thisPartyApplicationEditorUsePK.equals(thatPartyApplicationEditorUsePK);
207                }
208            }
209            
210            if(objectsEqual) {
211                PartyPK thisPartyPK = getPartyPK();
212                PartyPK thatPartyPK = that.getPartyPK();
213                
214                if(thisPartyPK == null) {
215                    objectsEqual = objectsEqual && (thatPartyPK == null);
216                } else {
217                    objectsEqual = objectsEqual && thisPartyPK.equals(thatPartyPK);
218                }
219            }
220            
221            if(objectsEqual) {
222                ApplicationEditorUsePK thisApplicationEditorUsePK = getApplicationEditorUsePK();
223                ApplicationEditorUsePK thatApplicationEditorUsePK = that.getApplicationEditorUsePK();
224                
225                if(thisApplicationEditorUsePK == null) {
226                    objectsEqual = objectsEqual && (thatApplicationEditorUsePK == null);
227                } else {
228                    objectsEqual = objectsEqual && thisApplicationEditorUsePK.equals(thatApplicationEditorUsePK);
229                }
230            }
231            
232            if(objectsEqual) {
233                ApplicationEditorPK thisApplicationEditorPK = getApplicationEditorPK();
234                ApplicationEditorPK thatApplicationEditorPK = that.getApplicationEditorPK();
235                
236                if(thisApplicationEditorPK == null) {
237                    objectsEqual = objectsEqual && (thatApplicationEditorPK == null);
238                } else {
239                    objectsEqual = objectsEqual && thisApplicationEditorPK.equals(thatApplicationEditorPK);
240                }
241            }
242            
243            if(objectsEqual) {
244                Integer thisPreferredHeight = getPreferredHeight();
245                Integer thatPreferredHeight = that.getPreferredHeight();
246                
247                if(thisPreferredHeight == null) {
248                    objectsEqual = objectsEqual && (thatPreferredHeight == null);
249                } else {
250                    objectsEqual = objectsEqual && thisPreferredHeight.equals(thatPreferredHeight);
251                }
252            }
253            
254            if(objectsEqual) {
255                Integer thisPreferredWidth = getPreferredWidth();
256                Integer thatPreferredWidth = that.getPreferredWidth();
257                
258                if(thisPreferredWidth == null) {
259                    objectsEqual = objectsEqual && (thatPreferredWidth == null);
260                } else {
261                    objectsEqual = objectsEqual && thisPreferredWidth.equals(thatPreferredWidth);
262                }
263            }
264            
265            if(objectsEqual) {
266                Long thisFromTime = getFromTime();
267                Long thatFromTime = that.getFromTime();
268                
269                if(thisFromTime == null) {
270                    objectsEqual = objectsEqual && (thatFromTime == null);
271                } else {
272                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
273                }
274            }
275            
276            if(objectsEqual) {
277                Long thisThruTime = getThruTime();
278                Long thatThruTime = that.getThruTime();
279                
280                if(thisThruTime == null) {
281                    objectsEqual = objectsEqual && (thatThruTime == null);
282                } else {
283                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
284                }
285            }
286            
287            return objectsEqual;
288        } else {
289            return false;
290        }
291    }
292    
293    @Override
294    public boolean hasBeenModified() {
295        return partyApplicationEditorUsePKHasBeenModified || partyPKHasBeenModified || applicationEditorUsePKHasBeenModified || applicationEditorPKHasBeenModified || preferredHeightHasBeenModified || preferredWidthHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
296    }
297    
298    @Override
299    public void clearHasBeenModified() {
300        partyApplicationEditorUsePKHasBeenModified = false;
301        partyPKHasBeenModified = false;
302        applicationEditorUsePKHasBeenModified = false;
303        applicationEditorPKHasBeenModified = false;
304        preferredHeightHasBeenModified = false;
305        preferredWidthHasBeenModified = false;
306        fromTimeHasBeenModified = false;
307        thruTimeHasBeenModified = false;
308    }
309    
310    public PartyApplicationEditorUsePK getPartyApplicationEditorUsePK() {
311        return partyApplicationEditorUsePK;
312    }
313    
314    public void setPartyApplicationEditorUsePK(PartyApplicationEditorUsePK partyApplicationEditorUsePK)
315            throws PersistenceNotNullException {
316        checkForNull(partyApplicationEditorUsePK);
317        
318        boolean update = true;
319        
320        if(this.partyApplicationEditorUsePK != null) {
321            if(this.partyApplicationEditorUsePK.equals(partyApplicationEditorUsePK)) {
322                update = false;
323            }
324        } else if(partyApplicationEditorUsePK == null) {
325            update = false;
326        }
327        
328        if(update) {
329            this.partyApplicationEditorUsePK = partyApplicationEditorUsePK;
330            partyApplicationEditorUsePKHasBeenModified = true;
331            clearHashAndString();
332        }
333    }
334    
335    public boolean getPartyApplicationEditorUsePKHasBeenModified() {
336        return partyApplicationEditorUsePKHasBeenModified;
337    }
338    
339    public PartyPK getPartyPK() {
340        return partyPK;
341    }
342    
343    public void setPartyPK(PartyPK partyPK)
344            throws PersistenceNotNullException {
345        checkForNull(partyPK);
346        
347        boolean update = true;
348        
349        if(this.partyPK != null) {
350            if(this.partyPK.equals(partyPK)) {
351                update = false;
352            }
353        } else if(partyPK == null) {
354            update = false;
355        }
356        
357        if(update) {
358            this.partyPK = partyPK;
359            partyPKHasBeenModified = true;
360            clearHashAndString();
361        }
362    }
363    
364    public boolean getPartyPKHasBeenModified() {
365        return partyPKHasBeenModified;
366    }
367    
368    public ApplicationEditorUsePK getApplicationEditorUsePK() {
369        return applicationEditorUsePK;
370    }
371    
372    public void setApplicationEditorUsePK(ApplicationEditorUsePK applicationEditorUsePK)
373            throws PersistenceNotNullException {
374        checkForNull(applicationEditorUsePK);
375        
376        boolean update = true;
377        
378        if(this.applicationEditorUsePK != null) {
379            if(this.applicationEditorUsePK.equals(applicationEditorUsePK)) {
380                update = false;
381            }
382        } else if(applicationEditorUsePK == null) {
383            update = false;
384        }
385        
386        if(update) {
387            this.applicationEditorUsePK = applicationEditorUsePK;
388            applicationEditorUsePKHasBeenModified = true;
389            clearHashAndString();
390        }
391    }
392    
393    public boolean getApplicationEditorUsePKHasBeenModified() {
394        return applicationEditorUsePKHasBeenModified;
395    }
396    
397    public ApplicationEditorPK getApplicationEditorPK() {
398        return applicationEditorPK;
399    }
400    
401    public void setApplicationEditorPK(ApplicationEditorPK applicationEditorPK) {
402        boolean update = true;
403        
404        if(this.applicationEditorPK != null) {
405            if(this.applicationEditorPK.equals(applicationEditorPK)) {
406                update = false;
407            }
408        } else if(applicationEditorPK == null) {
409            update = false;
410        }
411        
412        if(update) {
413            this.applicationEditorPK = applicationEditorPK;
414            applicationEditorPKHasBeenModified = true;
415            clearHashAndString();
416        }
417    }
418    
419    public boolean getApplicationEditorPKHasBeenModified() {
420        return applicationEditorPKHasBeenModified;
421    }
422    
423    public Integer getPreferredHeight() {
424        return preferredHeight;
425    }
426    
427    public void setPreferredHeight(Integer preferredHeight) {
428        boolean update = true;
429        
430        if(this.preferredHeight != null) {
431            if(this.preferredHeight.equals(preferredHeight)) {
432                update = false;
433            }
434        } else if(preferredHeight == null) {
435            update = false;
436        }
437        
438        if(update) {
439            this.preferredHeight = preferredHeight;
440            preferredHeightHasBeenModified = true;
441            clearHashAndString();
442        }
443    }
444    
445    public boolean getPreferredHeightHasBeenModified() {
446        return preferredHeightHasBeenModified;
447    }
448    
449    public Integer getPreferredWidth() {
450        return preferredWidth;
451    }
452    
453    public void setPreferredWidth(Integer preferredWidth) {
454        boolean update = true;
455        
456        if(this.preferredWidth != null) {
457            if(this.preferredWidth.equals(preferredWidth)) {
458                update = false;
459            }
460        } else if(preferredWidth == null) {
461            update = false;
462        }
463        
464        if(update) {
465            this.preferredWidth = preferredWidth;
466            preferredWidthHasBeenModified = true;
467            clearHashAndString();
468        }
469    }
470    
471    public boolean getPreferredWidthHasBeenModified() {
472        return preferredWidthHasBeenModified;
473    }
474    
475    public Long getFromTime() {
476        return fromTime;
477    }
478    
479    public void setFromTime(Long fromTime)
480            throws PersistenceNotNullException {
481        checkForNull(fromTime);
482        
483        boolean update = true;
484        
485        if(this.fromTime != null) {
486            if(this.fromTime.equals(fromTime)) {
487                update = false;
488            }
489        } else if(fromTime == null) {
490            update = false;
491        }
492        
493        if(update) {
494            this.fromTime = fromTime;
495            fromTimeHasBeenModified = true;
496            clearHashAndString();
497        }
498    }
499    
500    public boolean getFromTimeHasBeenModified() {
501        return fromTimeHasBeenModified;
502    }
503    
504    public Long getThruTime() {
505        return thruTime;
506    }
507    
508    public void setThruTime(Long thruTime)
509            throws PersistenceNotNullException {
510        checkForNull(thruTime);
511        
512        boolean update = true;
513        
514        if(this.thruTime != null) {
515            if(this.thruTime.equals(thruTime)) {
516                update = false;
517            }
518        } else if(thruTime == null) {
519            update = false;
520        }
521        
522        if(update) {
523            this.thruTime = thruTime;
524            thruTimeHasBeenModified = true;
525            clearHashAndString();
526        }
527    }
528    
529    public boolean getThruTimeHasBeenModified() {
530        return thruTimeHasBeenModified;
531    }
532    
533}