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 * PaymentMethodCreditCard.java
021 */
022
023package com.echothree.model.data.payment.server.entity;
024
025import com.echothree.model.data.payment.common.pk.PaymentMethodCreditCardPK;
026
027import com.echothree.model.data.payment.common.pk.PaymentMethodPK;
028
029import com.echothree.model.data.payment.server.entity.PaymentMethod;
030
031import com.echothree.model.data.payment.server.factory.PaymentMethodFactory;
032
033import com.echothree.model.data.payment.common.pk.PaymentMethodCreditCardPK;
034
035import com.echothree.model.data.payment.server.value.PaymentMethodCreditCardValue;
036
037import com.echothree.model.data.payment.server.factory.PaymentMethodCreditCardFactory;
038
039import com.echothree.util.common.exception.PersistenceException;
040import com.echothree.util.common.exception.PersistenceDatabaseException;
041import com.echothree.util.common.exception.PersistenceNotNullException;
042import com.echothree.util.common.exception.PersistenceReadOnlyException;
043
044import com.echothree.util.common.persistence.BasePK;
045
046import com.echothree.util.common.persistence.type.ByteArray;
047
048import com.echothree.util.server.persistence.BaseEntity;
049import com.echothree.util.server.persistence.EntityPermission;
050import com.echothree.util.server.persistence.Session;
051import com.echothree.util.server.persistence.ThreadSession;
052
053import java.io.Serializable;
054
055public class PaymentMethodCreditCard
056        extends BaseEntity
057        implements Serializable {
058    
059    private PaymentMethodCreditCardPK _pk;
060    private PaymentMethodCreditCardValue _value;
061    
062    /** Creates a new instance of PaymentMethodCreditCard */
063    public PaymentMethodCreditCard()
064            throws PersistenceException {
065        super();
066    }
067    
068    /** Creates a new instance of PaymentMethodCreditCard */
069    public PaymentMethodCreditCard(PaymentMethodCreditCardValue value, EntityPermission entityPermission) {
070        super(entityPermission);
071        
072        _value = value;
073        _pk = value.getPrimaryKey();
074    }
075    
076    @Override
077    public PaymentMethodCreditCardFactory getBaseFactoryInstance() {
078        return PaymentMethodCreditCardFactory.getInstance();
079    }
080    
081    @Override
082    public boolean hasBeenModified() {
083        return _value.hasBeenModified();
084    }
085    
086    @Override
087    public int hashCode() {
088        return _pk.hashCode();
089    }
090    
091    @Override
092    public String toString() {
093        return _pk.toString();
094    }
095    
096    @Override
097    public boolean equals(Object other) {
098        if(this == other)
099            return true;
100        
101        if(other instanceof PaymentMethodCreditCard that) {
102            PaymentMethodCreditCardValue thatValue = that.getPaymentMethodCreditCardValue();
103            return _value.equals(thatValue);
104        } else {
105            return false;
106        }
107    }
108    
109    @Override
110    public void store()
111            throws PersistenceDatabaseException {
112        getBaseFactoryInstance().store(this);
113    }
114    
115    @Override
116    public void remove()
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().remove(this);
119    }
120    
121    public PaymentMethodCreditCardValue getPaymentMethodCreditCardValue() {
122        return _value;
123    }
124    
125    public void setPaymentMethodCreditCardValue(PaymentMethodCreditCardValue value)
126            throws PersistenceReadOnlyException {
127        checkReadWrite();
128        _value = value;
129    }
130    
131    @Override
132    public PaymentMethodCreditCardPK getPrimaryKey() {
133        return _pk;
134    }
135    
136    public PaymentMethodPK getPaymentMethodPK() {
137        return _value.getPaymentMethodPK();
138    }
139    
140    public PaymentMethod getPaymentMethod(EntityPermission entityPermission) {
141        return PaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodPK());
142    }
143    
144    public PaymentMethod getPaymentMethod() {
145        return getPaymentMethod(EntityPermission.READ_ONLY);
146    }
147    
148    public PaymentMethod getPaymentMethodForUpdate() {
149        return getPaymentMethod(EntityPermission.READ_WRITE);
150    }
151    
152    public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK)
153            throws PersistenceNotNullException, PersistenceReadOnlyException {
154        checkReadWrite();
155        _value.setPaymentMethodPK(paymentMethodPK);
156    }
157    
158    public void setPaymentMethod(PaymentMethod entity) {
159        setPaymentMethodPK(entity == null? null: entity.getPrimaryKey());
160    }
161    
162    public boolean getPaymentMethodPKHasBeenModified() {
163        return _value.getPaymentMethodPKHasBeenModified();
164    }
165    
166    public Boolean getRequestNameOnCard() {
167        return _value.getRequestNameOnCard();
168    }
169    
170    public void setRequestNameOnCard(Boolean requestNameOnCard)
171            throws PersistenceNotNullException, PersistenceReadOnlyException {
172        checkReadWrite();
173        _value.setRequestNameOnCard(requestNameOnCard);
174    }
175    
176    public boolean getRequestNameOnCardHasBeenModified() {
177        return _value.getRequestNameOnCardHasBeenModified();
178    }
179    
180    public Boolean getRequireNameOnCard() {
181        return _value.getRequireNameOnCard();
182    }
183    
184    public void setRequireNameOnCard(Boolean requireNameOnCard)
185            throws PersistenceNotNullException, PersistenceReadOnlyException {
186        checkReadWrite();
187        _value.setRequireNameOnCard(requireNameOnCard);
188    }
189    
190    public boolean getRequireNameOnCardHasBeenModified() {
191        return _value.getRequireNameOnCardHasBeenModified();
192    }
193    
194    public Boolean getCheckCardNumber() {
195        return _value.getCheckCardNumber();
196    }
197    
198    public void setCheckCardNumber(Boolean checkCardNumber)
199            throws PersistenceNotNullException, PersistenceReadOnlyException {
200        checkReadWrite();
201        _value.setCheckCardNumber(checkCardNumber);
202    }
203    
204    public boolean getCheckCardNumberHasBeenModified() {
205        return _value.getCheckCardNumberHasBeenModified();
206    }
207    
208    public Boolean getRequestExpirationDate() {
209        return _value.getRequestExpirationDate();
210    }
211    
212    public void setRequestExpirationDate(Boolean requestExpirationDate)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setRequestExpirationDate(requestExpirationDate);
216    }
217    
218    public boolean getRequestExpirationDateHasBeenModified() {
219        return _value.getRequestExpirationDateHasBeenModified();
220    }
221    
222    public Boolean getRequireExpirationDate() {
223        return _value.getRequireExpirationDate();
224    }
225    
226    public void setRequireExpirationDate(Boolean requireExpirationDate)
227            throws PersistenceNotNullException, PersistenceReadOnlyException {
228        checkReadWrite();
229        _value.setRequireExpirationDate(requireExpirationDate);
230    }
231    
232    public boolean getRequireExpirationDateHasBeenModified() {
233        return _value.getRequireExpirationDateHasBeenModified();
234    }
235    
236    public Boolean getCheckExpirationDate() {
237        return _value.getCheckExpirationDate();
238    }
239    
240    public void setCheckExpirationDate(Boolean checkExpirationDate)
241            throws PersistenceNotNullException, PersistenceReadOnlyException {
242        checkReadWrite();
243        _value.setCheckExpirationDate(checkExpirationDate);
244    }
245    
246    public boolean getCheckExpirationDateHasBeenModified() {
247        return _value.getCheckExpirationDateHasBeenModified();
248    }
249    
250    public Boolean getRequestSecurityCode() {
251        return _value.getRequestSecurityCode();
252    }
253    
254    public void setRequestSecurityCode(Boolean requestSecurityCode)
255            throws PersistenceNotNullException, PersistenceReadOnlyException {
256        checkReadWrite();
257        _value.setRequestSecurityCode(requestSecurityCode);
258    }
259    
260    public boolean getRequestSecurityCodeHasBeenModified() {
261        return _value.getRequestSecurityCodeHasBeenModified();
262    }
263    
264    public Boolean getRequireSecurityCode() {
265        return _value.getRequireSecurityCode();
266    }
267    
268    public void setRequireSecurityCode(Boolean requireSecurityCode)
269            throws PersistenceNotNullException, PersistenceReadOnlyException {
270        checkReadWrite();
271        _value.setRequireSecurityCode(requireSecurityCode);
272    }
273    
274    public boolean getRequireSecurityCodeHasBeenModified() {
275        return _value.getRequireSecurityCodeHasBeenModified();
276    }
277    
278    public String getCardNumberValidationPattern() {
279        return _value.getCardNumberValidationPattern();
280    }
281    
282    public void setCardNumberValidationPattern(String cardNumberValidationPattern)
283            throws PersistenceNotNullException, PersistenceReadOnlyException {
284        checkReadWrite();
285        _value.setCardNumberValidationPattern(cardNumberValidationPattern);
286    }
287    
288    public boolean getCardNumberValidationPatternHasBeenModified() {
289        return _value.getCardNumberValidationPatternHasBeenModified();
290    }
291    
292    public String getSecurityCodeValidationPattern() {
293        return _value.getSecurityCodeValidationPattern();
294    }
295    
296    public void setSecurityCodeValidationPattern(String securityCodeValidationPattern)
297            throws PersistenceNotNullException, PersistenceReadOnlyException {
298        checkReadWrite();
299        _value.setSecurityCodeValidationPattern(securityCodeValidationPattern);
300    }
301    
302    public boolean getSecurityCodeValidationPatternHasBeenModified() {
303        return _value.getSecurityCodeValidationPatternHasBeenModified();
304    }
305    
306    public Boolean getRetainCreditCard() {
307        return _value.getRetainCreditCard();
308    }
309    
310    public void setRetainCreditCard(Boolean retainCreditCard)
311            throws PersistenceNotNullException, PersistenceReadOnlyException {
312        checkReadWrite();
313        _value.setRetainCreditCard(retainCreditCard);
314    }
315    
316    public boolean getRetainCreditCardHasBeenModified() {
317        return _value.getRetainCreditCardHasBeenModified();
318    }
319    
320    public Boolean getRetainSecurityCode() {
321        return _value.getRetainSecurityCode();
322    }
323    
324    public void setRetainSecurityCode(Boolean retainSecurityCode)
325            throws PersistenceNotNullException, PersistenceReadOnlyException {
326        checkReadWrite();
327        _value.setRetainSecurityCode(retainSecurityCode);
328    }
329    
330    public boolean getRetainSecurityCodeHasBeenModified() {
331        return _value.getRetainSecurityCodeHasBeenModified();
332    }
333    
334    public Boolean getRequestBilling() {
335        return _value.getRequestBilling();
336    }
337    
338    public void setRequestBilling(Boolean requestBilling)
339            throws PersistenceNotNullException, PersistenceReadOnlyException {
340        checkReadWrite();
341        _value.setRequestBilling(requestBilling);
342    }
343    
344    public boolean getRequestBillingHasBeenModified() {
345        return _value.getRequestBillingHasBeenModified();
346    }
347    
348    public Boolean getRequireBilling() {
349        return _value.getRequireBilling();
350    }
351    
352    public void setRequireBilling(Boolean requireBilling)
353            throws PersistenceNotNullException, PersistenceReadOnlyException {
354        checkReadWrite();
355        _value.setRequireBilling(requireBilling);
356    }
357    
358    public boolean getRequireBillingHasBeenModified() {
359        return _value.getRequireBillingHasBeenModified();
360    }
361    
362    public Boolean getRequestIssuer() {
363        return _value.getRequestIssuer();
364    }
365    
366    public void setRequestIssuer(Boolean requestIssuer)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setRequestIssuer(requestIssuer);
370    }
371    
372    public boolean getRequestIssuerHasBeenModified() {
373        return _value.getRequestIssuerHasBeenModified();
374    }
375    
376    public Boolean getRequireIssuer() {
377        return _value.getRequireIssuer();
378    }
379    
380    public void setRequireIssuer(Boolean requireIssuer)
381            throws PersistenceNotNullException, PersistenceReadOnlyException {
382        checkReadWrite();
383        _value.setRequireIssuer(requireIssuer);
384    }
385    
386    public boolean getRequireIssuerHasBeenModified() {
387        return _value.getRequireIssuerHasBeenModified();
388    }
389    
390    public Long getFromTime() {
391        return _value.getFromTime();
392    }
393    
394    public void setFromTime(Long fromTime)
395            throws PersistenceNotNullException, PersistenceReadOnlyException {
396        checkReadWrite();
397        _value.setFromTime(fromTime);
398    }
399    
400    public boolean getFromTimeHasBeenModified() {
401        return _value.getFromTimeHasBeenModified();
402    }
403    
404    public Long getThruTime() {
405        return _value.getThruTime();
406    }
407    
408    public void setThruTime(Long thruTime)
409            throws PersistenceNotNullException, PersistenceReadOnlyException {
410        checkReadWrite();
411        _value.setThruTime(thruTime);
412    }
413    
414    public boolean getThruTimeHasBeenModified() {
415        return _value.getThruTimeHasBeenModified();
416    }
417    
418}