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