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