001// --------------------------------------------------------------------------------
002// Copyright 2002-2024 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            StringBuilder stringValue = new StringBuilder("{");
153            
154            stringValue.append("entityId=").append(getEntityId());
155            
156            stringValue.append(", paymentProcessorTransactionPK=").append(getPaymentProcessorTransactionPK());
157            stringValue.append(", paymentProcessorTransactionName=").append(getPaymentProcessorTransactionName());
158            stringValue.append(", paymentProcessorPK=").append(getPaymentProcessorPK());
159            stringValue.append(", paymentProcessorActionTypePK=").append(getPaymentProcessorActionTypePK());
160            stringValue.append(", paymentProcessorResultCodePK=").append(getPaymentProcessorResultCodePK());
161            stringValue.append(", fromTime=").append(getFromTime());
162            stringValue.append(", thruTime=").append(getThruTime());
163            
164            stringValue.append('}');
165            
166            _stringValue = stringValue.toString();
167        }
168        return _stringValue;
169    }
170    
171    @Override
172    public boolean equals(Object other) {
173        if(this == other)
174            return true;
175        
176        if(!hasIdentity())
177            return false;
178        
179        if(other instanceof  PaymentProcessorTransactionDetailValue) {
180            PaymentProcessorTransactionDetailValue that = (PaymentProcessorTransactionDetailValue)other;
181            
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 = 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) {
200            PaymentProcessorTransactionDetailValue that = (PaymentProcessorTransactionDetailValue)other;
201            boolean objectsEqual = true;
202            
203            
204            if(objectsEqual) {
205                PaymentProcessorTransactionPK thisPaymentProcessorTransactionPK = getPaymentProcessorTransactionPK();
206                PaymentProcessorTransactionPK thatPaymentProcessorTransactionPK = that.getPaymentProcessorTransactionPK();
207                
208                if(thisPaymentProcessorTransactionPK == null) {
209                    objectsEqual = objectsEqual && (thatPaymentProcessorTransactionPK == null);
210                } else {
211                    objectsEqual = objectsEqual && thisPaymentProcessorTransactionPK.equals(thatPaymentProcessorTransactionPK);
212                }
213            }
214            
215            if(objectsEqual) {
216                String thisPaymentProcessorTransactionName = getPaymentProcessorTransactionName();
217                String thatPaymentProcessorTransactionName = that.getPaymentProcessorTransactionName();
218                
219                if(thisPaymentProcessorTransactionName == null) {
220                    objectsEqual = objectsEqual && (thatPaymentProcessorTransactionName == null);
221                } else {
222                    objectsEqual = objectsEqual && thisPaymentProcessorTransactionName.equals(thatPaymentProcessorTransactionName);
223                }
224            }
225            
226            if(objectsEqual) {
227                PaymentProcessorPK thisPaymentProcessorPK = getPaymentProcessorPK();
228                PaymentProcessorPK thatPaymentProcessorPK = that.getPaymentProcessorPK();
229                
230                if(thisPaymentProcessorPK == null) {
231                    objectsEqual = objectsEqual && (thatPaymentProcessorPK == null);
232                } else {
233                    objectsEqual = objectsEqual && thisPaymentProcessorPK.equals(thatPaymentProcessorPK);
234                }
235            }
236            
237            if(objectsEqual) {
238                PaymentProcessorActionTypePK thisPaymentProcessorActionTypePK = getPaymentProcessorActionTypePK();
239                PaymentProcessorActionTypePK thatPaymentProcessorActionTypePK = that.getPaymentProcessorActionTypePK();
240                
241                if(thisPaymentProcessorActionTypePK == null) {
242                    objectsEqual = objectsEqual && (thatPaymentProcessorActionTypePK == null);
243                } else {
244                    objectsEqual = objectsEqual && thisPaymentProcessorActionTypePK.equals(thatPaymentProcessorActionTypePK);
245                }
246            }
247            
248            if(objectsEqual) {
249                PaymentProcessorResultCodePK thisPaymentProcessorResultCodePK = getPaymentProcessorResultCodePK();
250                PaymentProcessorResultCodePK thatPaymentProcessorResultCodePK = that.getPaymentProcessorResultCodePK();
251                
252                if(thisPaymentProcessorResultCodePK == null) {
253                    objectsEqual = objectsEqual && (thatPaymentProcessorResultCodePK == null);
254                } else {
255                    objectsEqual = objectsEqual && thisPaymentProcessorResultCodePK.equals(thatPaymentProcessorResultCodePK);
256                }
257            }
258            
259            if(objectsEqual) {
260                Long thisFromTime = getFromTime();
261                Long thatFromTime = that.getFromTime();
262                
263                if(thisFromTime == null) {
264                    objectsEqual = objectsEqual && (thatFromTime == null);
265                } else {
266                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
267                }
268            }
269            
270            if(objectsEqual) {
271                Long thisThruTime = getThruTime();
272                Long thatThruTime = that.getThruTime();
273                
274                if(thisThruTime == null) {
275                    objectsEqual = objectsEqual && (thatThruTime == null);
276                } else {
277                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
278                }
279            }
280            
281            return objectsEqual;
282        } else {
283            return false;
284        }
285    }
286    
287    @Override
288    public boolean hasBeenModified() {
289        return paymentProcessorTransactionPKHasBeenModified || paymentProcessorTransactionNameHasBeenModified || paymentProcessorPKHasBeenModified || paymentProcessorActionTypePKHasBeenModified || paymentProcessorResultCodePKHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
290    }
291    
292    @Override
293    public void clearHasBeenModified() {
294        paymentProcessorTransactionPKHasBeenModified = false;
295        paymentProcessorTransactionNameHasBeenModified = false;
296        paymentProcessorPKHasBeenModified = false;
297        paymentProcessorActionTypePKHasBeenModified = false;
298        paymentProcessorResultCodePKHasBeenModified = false;
299        fromTimeHasBeenModified = false;
300        thruTimeHasBeenModified = false;
301    }
302    
303    public PaymentProcessorTransactionPK getPaymentProcessorTransactionPK() {
304        return paymentProcessorTransactionPK;
305    }
306    
307    public void setPaymentProcessorTransactionPK(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    public String getPaymentProcessorTransactionName() {
333        return paymentProcessorTransactionName;
334    }
335    
336    public void setPaymentProcessorTransactionName(String paymentProcessorTransactionName)
337            throws PersistenceNotNullException {
338        checkForNull(paymentProcessorTransactionName);
339        
340        boolean update = true;
341        
342        if(this.paymentProcessorTransactionName != null) {
343            if(this.paymentProcessorTransactionName.equals(paymentProcessorTransactionName)) {
344                update = false;
345            }
346        } else if(paymentProcessorTransactionName == null) {
347            update = false;
348        }
349        
350        if(update) {
351            this.paymentProcessorTransactionName = paymentProcessorTransactionName;
352            paymentProcessorTransactionNameHasBeenModified = true;
353            clearHashAndString();
354        }
355    }
356    
357    public boolean getPaymentProcessorTransactionNameHasBeenModified() {
358        return paymentProcessorTransactionNameHasBeenModified;
359    }
360    
361    public PaymentProcessorPK getPaymentProcessorPK() {
362        return paymentProcessorPK;
363    }
364    
365    public void setPaymentProcessorPK(PaymentProcessorPK paymentProcessorPK)
366            throws PersistenceNotNullException {
367        checkForNull(paymentProcessorPK);
368        
369        boolean update = true;
370        
371        if(this.paymentProcessorPK != null) {
372            if(this.paymentProcessorPK.equals(paymentProcessorPK)) {
373                update = false;
374            }
375        } else if(paymentProcessorPK == null) {
376            update = false;
377        }
378        
379        if(update) {
380            this.paymentProcessorPK = paymentProcessorPK;
381            paymentProcessorPKHasBeenModified = true;
382            clearHashAndString();
383        }
384    }
385    
386    public boolean getPaymentProcessorPKHasBeenModified() {
387        return paymentProcessorPKHasBeenModified;
388    }
389    
390    public PaymentProcessorActionTypePK getPaymentProcessorActionTypePK() {
391        return paymentProcessorActionTypePK;
392    }
393    
394    public void setPaymentProcessorActionTypePK(PaymentProcessorActionTypePK paymentProcessorActionTypePK)
395            throws PersistenceNotNullException {
396        checkForNull(paymentProcessorActionTypePK);
397        
398        boolean update = true;
399        
400        if(this.paymentProcessorActionTypePK != null) {
401            if(this.paymentProcessorActionTypePK.equals(paymentProcessorActionTypePK)) {
402                update = false;
403            }
404        } else if(paymentProcessorActionTypePK == null) {
405            update = false;
406        }
407        
408        if(update) {
409            this.paymentProcessorActionTypePK = paymentProcessorActionTypePK;
410            paymentProcessorActionTypePKHasBeenModified = true;
411            clearHashAndString();
412        }
413    }
414    
415    public boolean getPaymentProcessorActionTypePKHasBeenModified() {
416        return paymentProcessorActionTypePKHasBeenModified;
417    }
418    
419    public PaymentProcessorResultCodePK getPaymentProcessorResultCodePK() {
420        return paymentProcessorResultCodePK;
421    }
422    
423    public void setPaymentProcessorResultCodePK(PaymentProcessorResultCodePK paymentProcessorResultCodePK)
424            throws PersistenceNotNullException {
425        checkForNull(paymentProcessorResultCodePK);
426        
427        boolean update = true;
428        
429        if(this.paymentProcessorResultCodePK != null) {
430            if(this.paymentProcessorResultCodePK.equals(paymentProcessorResultCodePK)) {
431                update = false;
432            }
433        } else if(paymentProcessorResultCodePK == null) {
434            update = false;
435        }
436        
437        if(update) {
438            this.paymentProcessorResultCodePK = paymentProcessorResultCodePK;
439            paymentProcessorResultCodePKHasBeenModified = true;
440            clearHashAndString();
441        }
442    }
443    
444    public boolean getPaymentProcessorResultCodePKHasBeenModified() {
445        return paymentProcessorResultCodePKHasBeenModified;
446    }
447    
448    public Long getFromTime() {
449        return fromTime;
450    }
451    
452    public void setFromTime(Long fromTime)
453            throws PersistenceNotNullException {
454        checkForNull(fromTime);
455        
456        boolean update = true;
457        
458        if(this.fromTime != null) {
459            if(this.fromTime.equals(fromTime)) {
460                update = false;
461            }
462        } else if(fromTime == null) {
463            update = false;
464        }
465        
466        if(update) {
467            this.fromTime = fromTime;
468            fromTimeHasBeenModified = true;
469            clearHashAndString();
470        }
471    }
472    
473    public boolean getFromTimeHasBeenModified() {
474        return fromTimeHasBeenModified;
475    }
476    
477    public Long getThruTime() {
478        return thruTime;
479    }
480    
481    public void setThruTime(Long thruTime)
482            throws PersistenceNotNullException {
483        checkForNull(thruTime);
484        
485        boolean update = true;
486        
487        if(this.thruTime != null) {
488            if(this.thruTime.equals(thruTime)) {
489                update = false;
490            }
491        } else if(thruTime == null) {
492            update = false;
493        }
494        
495        if(update) {
496            this.thruTime = thruTime;
497            thruTimeHasBeenModified = true;
498            clearHashAndString();
499        }
500    }
501    
502    public boolean getThruTimeHasBeenModified() {
503        return thruTimeHasBeenModified;
504    }
505    
506}