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 * CarrierOptionDetail.java
021 */
022
023package com.echothree.model.data.carrier.server.entity;
024
025import com.echothree.model.data.carrier.common.pk.CarrierOptionDetailPK;
026
027import com.echothree.model.data.carrier.common.pk.CarrierOptionPK;
028import com.echothree.model.data.party.common.pk.PartyPK;
029import com.echothree.model.data.selector.common.pk.SelectorPK;
030
031import com.echothree.model.data.carrier.server.entity.CarrierOption;
032import com.echothree.model.data.party.server.entity.Party;
033import com.echothree.model.data.selector.server.entity.Selector;
034
035import com.echothree.model.data.carrier.server.factory.CarrierOptionFactory;
036import com.echothree.model.data.party.server.factory.PartyFactory;
037import com.echothree.model.data.selector.server.factory.SelectorFactory;
038
039import com.echothree.model.data.carrier.common.pk.CarrierOptionDetailPK;
040
041import com.echothree.model.data.carrier.server.value.CarrierOptionDetailValue;
042
043import com.echothree.model.data.carrier.server.factory.CarrierOptionDetailFactory;
044
045import com.echothree.util.common.exception.PersistenceException;
046import com.echothree.util.common.exception.PersistenceDatabaseException;
047import com.echothree.util.common.exception.PersistenceNotNullException;
048import com.echothree.util.common.exception.PersistenceReadOnlyException;
049
050import com.echothree.util.common.persistence.BasePK;
051
052import com.echothree.util.common.persistence.type.ByteArray;
053
054import com.echothree.util.server.persistence.BaseEntity;
055import com.echothree.util.server.persistence.EntityPermission;
056import com.echothree.util.server.persistence.Session;
057import com.echothree.util.server.persistence.ThreadSession;
058
059import java.io.Serializable;
060
061import javax.annotation.Nonnull;
062import javax.annotation.Nullable;
063
064public class CarrierOptionDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private CarrierOptionDetailPK _pk;
069    private CarrierOptionDetailValue _value;
070    
071    /** Creates a new instance of CarrierOptionDetail */
072    public CarrierOptionDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of CarrierOptionDetail */
078    public CarrierOptionDetail(CarrierOptionDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    @Nonnull
087    public CarrierOptionDetailFactory getBaseFactoryInstance() {
088        return CarrierOptionDetailFactory.getInstance();
089    }
090    
091    @Override
092    public boolean hasBeenModified() {
093        return _value.hasBeenModified();
094    }
095    
096    @Override
097    public int hashCode() {
098        return _pk.hashCode();
099    }
100    
101    @Override
102    @Nonnull
103    public String toString() {
104        return _pk.toString();
105    }
106    
107    @Override
108    public boolean equals(Object other) {
109        if(this == other)
110            return true;
111        
112        if(other instanceof CarrierOptionDetail that) {
113            CarrierOptionDetailValue thatValue = that.getCarrierOptionDetailValue();
114            return _value.equals(thatValue);
115        } else {
116            return false;
117        }
118    }
119    
120    @Override
121    public void store()
122            throws PersistenceDatabaseException {
123        getBaseFactoryInstance().store(this);
124    }
125    
126    @Override
127    public void remove()
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().remove(this);
130    }
131    
132    @Nonnull
133    public CarrierOptionDetailValue getCarrierOptionDetailValue() {
134        return _value;
135    }
136    
137    public void setCarrierOptionDetailValue(@Nonnull CarrierOptionDetailValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    @Nonnull
145    public CarrierOptionDetailPK getPrimaryKey() {
146        return _pk;
147    }
148    
149    @Nonnull
150    public CarrierOptionPK getCarrierOptionPK() {
151        return _value.getCarrierOptionPK();
152    }
153    
154    @Nonnull
155    public CarrierOption getCarrierOption(EntityPermission entityPermission) {
156        return CarrierOptionFactory.getInstance().getEntityFromPK(entityPermission, getCarrierOptionPK());
157    }
158    
159    @Nonnull
160    public CarrierOption getCarrierOption() {
161        return getCarrierOption(EntityPermission.READ_ONLY);
162    }
163    
164    @Nonnull
165    public CarrierOption getCarrierOptionForUpdate() {
166        return getCarrierOption(EntityPermission.READ_WRITE);
167    }
168    
169    public void setCarrierOptionPK(@Nonnull CarrierOptionPK carrierOptionPK)
170            throws PersistenceNotNullException, PersistenceReadOnlyException {
171        checkReadWrite();
172        _value.setCarrierOptionPK(carrierOptionPK);
173    }
174    
175    public void setCarrierOption(@Nonnull CarrierOption entity) {
176        setCarrierOptionPK(entity == null ? null : entity.getPrimaryKey());
177    }
178    
179    public boolean getCarrierOptionPKHasBeenModified() {
180        return _value.getCarrierOptionPKHasBeenModified();
181    }
182    
183    @Nonnull
184    public PartyPK getCarrierPartyPK() {
185        return _value.getCarrierPartyPK();
186    }
187    
188    @Nonnull
189    public Party getCarrierParty(EntityPermission entityPermission) {
190        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getCarrierPartyPK());
191    }
192    
193    @Nonnull
194    public Party getCarrierParty() {
195        return getCarrierParty(EntityPermission.READ_ONLY);
196    }
197    
198    @Nonnull
199    public Party getCarrierPartyForUpdate() {
200        return getCarrierParty(EntityPermission.READ_WRITE);
201    }
202    
203    public void setCarrierPartyPK(@Nonnull PartyPK carrierPartyPK)
204            throws PersistenceNotNullException, PersistenceReadOnlyException {
205        checkReadWrite();
206        _value.setCarrierPartyPK(carrierPartyPK);
207    }
208    
209    public void setCarrierParty(@Nonnull Party entity) {
210        setCarrierPartyPK(entity == null ? null : entity.getPrimaryKey());
211    }
212    
213    public boolean getCarrierPartyPKHasBeenModified() {
214        return _value.getCarrierPartyPKHasBeenModified();
215    }
216    
217    @Nonnull
218    public String getCarrierOptionName() {
219        return _value.getCarrierOptionName();
220    }
221    
222    public void setCarrierOptionName(@Nonnull String carrierOptionName)
223            throws PersistenceNotNullException, PersistenceReadOnlyException {
224        checkReadWrite();
225        _value.setCarrierOptionName(carrierOptionName);
226    }
227    
228    public boolean getCarrierOptionNameHasBeenModified() {
229        return _value.getCarrierOptionNameHasBeenModified();
230    }
231    
232    @Nonnull
233    public Boolean getIsRecommended() {
234        return _value.getIsRecommended();
235    }
236    
237    public void setIsRecommended(@Nonnull Boolean isRecommended)
238            throws PersistenceNotNullException, PersistenceReadOnlyException {
239        checkReadWrite();
240        _value.setIsRecommended(isRecommended);
241    }
242    
243    public boolean getIsRecommendedHasBeenModified() {
244        return _value.getIsRecommendedHasBeenModified();
245    }
246    
247    @Nonnull
248    public Boolean getIsRequired() {
249        return _value.getIsRequired();
250    }
251    
252    public void setIsRequired(@Nonnull Boolean isRequired)
253            throws PersistenceNotNullException, PersistenceReadOnlyException {
254        checkReadWrite();
255        _value.setIsRequired(isRequired);
256    }
257    
258    public boolean getIsRequiredHasBeenModified() {
259        return _value.getIsRequiredHasBeenModified();
260    }
261    
262    @Nullable
263    public SelectorPK getRecommendedGeoCodeSelectorPK() {
264        return _value.getRecommendedGeoCodeSelectorPK();
265    }
266    
267    @Nullable
268    public Selector getRecommendedGeoCodeSelector(EntityPermission entityPermission) {
269        SelectorPK pk = getRecommendedGeoCodeSelectorPK();
270        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
271        
272        return entity;
273    }
274    
275    @Nullable
276    public Selector getRecommendedGeoCodeSelector() {
277        return getRecommendedGeoCodeSelector(EntityPermission.READ_ONLY);
278    }
279    
280    @Nullable
281    public Selector getRecommendedGeoCodeSelectorForUpdate() {
282        return getRecommendedGeoCodeSelector(EntityPermission.READ_WRITE);
283    }
284    
285    public void setRecommendedGeoCodeSelectorPK(@Nullable SelectorPK recommendedGeoCodeSelectorPK)
286            throws PersistenceNotNullException, PersistenceReadOnlyException {
287        checkReadWrite();
288        _value.setRecommendedGeoCodeSelectorPK(recommendedGeoCodeSelectorPK);
289    }
290    
291    public void setRecommendedGeoCodeSelector(@Nullable Selector entity) {
292        setRecommendedGeoCodeSelectorPK(entity == null ? null : entity.getPrimaryKey());
293    }
294    
295    public boolean getRecommendedGeoCodeSelectorPKHasBeenModified() {
296        return _value.getRecommendedGeoCodeSelectorPKHasBeenModified();
297    }
298    
299    @Nullable
300    public SelectorPK getRequiredGeoCodeSelectorPK() {
301        return _value.getRequiredGeoCodeSelectorPK();
302    }
303    
304    @Nullable
305    public Selector getRequiredGeoCodeSelector(EntityPermission entityPermission) {
306        SelectorPK pk = getRequiredGeoCodeSelectorPK();
307        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
308        
309        return entity;
310    }
311    
312    @Nullable
313    public Selector getRequiredGeoCodeSelector() {
314        return getRequiredGeoCodeSelector(EntityPermission.READ_ONLY);
315    }
316    
317    @Nullable
318    public Selector getRequiredGeoCodeSelectorForUpdate() {
319        return getRequiredGeoCodeSelector(EntityPermission.READ_WRITE);
320    }
321    
322    public void setRequiredGeoCodeSelectorPK(@Nullable SelectorPK requiredGeoCodeSelectorPK)
323            throws PersistenceNotNullException, PersistenceReadOnlyException {
324        checkReadWrite();
325        _value.setRequiredGeoCodeSelectorPK(requiredGeoCodeSelectorPK);
326    }
327    
328    public void setRequiredGeoCodeSelector(@Nullable Selector entity) {
329        setRequiredGeoCodeSelectorPK(entity == null ? null : entity.getPrimaryKey());
330    }
331    
332    public boolean getRequiredGeoCodeSelectorPKHasBeenModified() {
333        return _value.getRequiredGeoCodeSelectorPKHasBeenModified();
334    }
335    
336    @Nullable
337    public SelectorPK getRecommendedItemSelectorPK() {
338        return _value.getRecommendedItemSelectorPK();
339    }
340    
341    @Nullable
342    public Selector getRecommendedItemSelector(EntityPermission entityPermission) {
343        SelectorPK pk = getRecommendedItemSelectorPK();
344        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
345        
346        return entity;
347    }
348    
349    @Nullable
350    public Selector getRecommendedItemSelector() {
351        return getRecommendedItemSelector(EntityPermission.READ_ONLY);
352    }
353    
354    @Nullable
355    public Selector getRecommendedItemSelectorForUpdate() {
356        return getRecommendedItemSelector(EntityPermission.READ_WRITE);
357    }
358    
359    public void setRecommendedItemSelectorPK(@Nullable SelectorPK recommendedItemSelectorPK)
360            throws PersistenceNotNullException, PersistenceReadOnlyException {
361        checkReadWrite();
362        _value.setRecommendedItemSelectorPK(recommendedItemSelectorPK);
363    }
364    
365    public void setRecommendedItemSelector(@Nullable Selector entity) {
366        setRecommendedItemSelectorPK(entity == null ? null : entity.getPrimaryKey());
367    }
368    
369    public boolean getRecommendedItemSelectorPKHasBeenModified() {
370        return _value.getRecommendedItemSelectorPKHasBeenModified();
371    }
372    
373    @Nullable
374    public SelectorPK getRequiredItemSelectorPK() {
375        return _value.getRequiredItemSelectorPK();
376    }
377    
378    @Nullable
379    public Selector getRequiredItemSelector(EntityPermission entityPermission) {
380        SelectorPK pk = getRequiredItemSelectorPK();
381        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
382        
383        return entity;
384    }
385    
386    @Nullable
387    public Selector getRequiredItemSelector() {
388        return getRequiredItemSelector(EntityPermission.READ_ONLY);
389    }
390    
391    @Nullable
392    public Selector getRequiredItemSelectorForUpdate() {
393        return getRequiredItemSelector(EntityPermission.READ_WRITE);
394    }
395    
396    public void setRequiredItemSelectorPK(@Nullable SelectorPK requiredItemSelectorPK)
397            throws PersistenceNotNullException, PersistenceReadOnlyException {
398        checkReadWrite();
399        _value.setRequiredItemSelectorPK(requiredItemSelectorPK);
400    }
401    
402    public void setRequiredItemSelector(@Nullable Selector entity) {
403        setRequiredItemSelectorPK(entity == null ? null : entity.getPrimaryKey());
404    }
405    
406    public boolean getRequiredItemSelectorPKHasBeenModified() {
407        return _value.getRequiredItemSelectorPKHasBeenModified();
408    }
409    
410    @Nullable
411    public SelectorPK getRecommendedOrderSelectorPK() {
412        return _value.getRecommendedOrderSelectorPK();
413    }
414    
415    @Nullable
416    public Selector getRecommendedOrderSelector(EntityPermission entityPermission) {
417        SelectorPK pk = getRecommendedOrderSelectorPK();
418        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
419        
420        return entity;
421    }
422    
423    @Nullable
424    public Selector getRecommendedOrderSelector() {
425        return getRecommendedOrderSelector(EntityPermission.READ_ONLY);
426    }
427    
428    @Nullable
429    public Selector getRecommendedOrderSelectorForUpdate() {
430        return getRecommendedOrderSelector(EntityPermission.READ_WRITE);
431    }
432    
433    public void setRecommendedOrderSelectorPK(@Nullable SelectorPK recommendedOrderSelectorPK)
434            throws PersistenceNotNullException, PersistenceReadOnlyException {
435        checkReadWrite();
436        _value.setRecommendedOrderSelectorPK(recommendedOrderSelectorPK);
437    }
438    
439    public void setRecommendedOrderSelector(@Nullable Selector entity) {
440        setRecommendedOrderSelectorPK(entity == null ? null : entity.getPrimaryKey());
441    }
442    
443    public boolean getRecommendedOrderSelectorPKHasBeenModified() {
444        return _value.getRecommendedOrderSelectorPKHasBeenModified();
445    }
446    
447    @Nullable
448    public SelectorPK getRequiredOrderSelectorPK() {
449        return _value.getRequiredOrderSelectorPK();
450    }
451    
452    @Nullable
453    public Selector getRequiredOrderSelector(EntityPermission entityPermission) {
454        SelectorPK pk = getRequiredOrderSelectorPK();
455        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
456        
457        return entity;
458    }
459    
460    @Nullable
461    public Selector getRequiredOrderSelector() {
462        return getRequiredOrderSelector(EntityPermission.READ_ONLY);
463    }
464    
465    @Nullable
466    public Selector getRequiredOrderSelectorForUpdate() {
467        return getRequiredOrderSelector(EntityPermission.READ_WRITE);
468    }
469    
470    public void setRequiredOrderSelectorPK(@Nullable SelectorPK requiredOrderSelectorPK)
471            throws PersistenceNotNullException, PersistenceReadOnlyException {
472        checkReadWrite();
473        _value.setRequiredOrderSelectorPK(requiredOrderSelectorPK);
474    }
475    
476    public void setRequiredOrderSelector(@Nullable Selector entity) {
477        setRequiredOrderSelectorPK(entity == null ? null : entity.getPrimaryKey());
478    }
479    
480    public boolean getRequiredOrderSelectorPKHasBeenModified() {
481        return _value.getRequiredOrderSelectorPKHasBeenModified();
482    }
483    
484    @Nullable
485    public SelectorPK getRecommendedShipmentSelectorPK() {
486        return _value.getRecommendedShipmentSelectorPK();
487    }
488    
489    @Nullable
490    public Selector getRecommendedShipmentSelector(EntityPermission entityPermission) {
491        SelectorPK pk = getRecommendedShipmentSelectorPK();
492        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
493        
494        return entity;
495    }
496    
497    @Nullable
498    public Selector getRecommendedShipmentSelector() {
499        return getRecommendedShipmentSelector(EntityPermission.READ_ONLY);
500    }
501    
502    @Nullable
503    public Selector getRecommendedShipmentSelectorForUpdate() {
504        return getRecommendedShipmentSelector(EntityPermission.READ_WRITE);
505    }
506    
507    public void setRecommendedShipmentSelectorPK(@Nullable SelectorPK recommendedShipmentSelectorPK)
508            throws PersistenceNotNullException, PersistenceReadOnlyException {
509        checkReadWrite();
510        _value.setRecommendedShipmentSelectorPK(recommendedShipmentSelectorPK);
511    }
512    
513    public void setRecommendedShipmentSelector(@Nullable Selector entity) {
514        setRecommendedShipmentSelectorPK(entity == null ? null : entity.getPrimaryKey());
515    }
516    
517    public boolean getRecommendedShipmentSelectorPKHasBeenModified() {
518        return _value.getRecommendedShipmentSelectorPKHasBeenModified();
519    }
520    
521    @Nullable
522    public SelectorPK getRequiredShipmentSelectorPK() {
523        return _value.getRequiredShipmentSelectorPK();
524    }
525    
526    @Nullable
527    public Selector getRequiredShipmentSelector(EntityPermission entityPermission) {
528        SelectorPK pk = getRequiredShipmentSelectorPK();
529        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
530        
531        return entity;
532    }
533    
534    @Nullable
535    public Selector getRequiredShipmentSelector() {
536        return getRequiredShipmentSelector(EntityPermission.READ_ONLY);
537    }
538    
539    @Nullable
540    public Selector getRequiredShipmentSelectorForUpdate() {
541        return getRequiredShipmentSelector(EntityPermission.READ_WRITE);
542    }
543    
544    public void setRequiredShipmentSelectorPK(@Nullable SelectorPK requiredShipmentSelectorPK)
545            throws PersistenceNotNullException, PersistenceReadOnlyException {
546        checkReadWrite();
547        _value.setRequiredShipmentSelectorPK(requiredShipmentSelectorPK);
548    }
549    
550    public void setRequiredShipmentSelector(@Nullable Selector entity) {
551        setRequiredShipmentSelectorPK(entity == null ? null : entity.getPrimaryKey());
552    }
553    
554    public boolean getRequiredShipmentSelectorPKHasBeenModified() {
555        return _value.getRequiredShipmentSelectorPKHasBeenModified();
556    }
557    
558    @Nonnull
559    public Boolean getIsDefault() {
560        return _value.getIsDefault();
561    }
562    
563    public void setIsDefault(@Nonnull Boolean isDefault)
564            throws PersistenceNotNullException, PersistenceReadOnlyException {
565        checkReadWrite();
566        _value.setIsDefault(isDefault);
567    }
568    
569    public boolean getIsDefaultHasBeenModified() {
570        return _value.getIsDefaultHasBeenModified();
571    }
572    
573    @Nonnull
574    public Integer getSortOrder() {
575        return _value.getSortOrder();
576    }
577    
578    public void setSortOrder(@Nonnull Integer sortOrder)
579            throws PersistenceNotNullException, PersistenceReadOnlyException {
580        checkReadWrite();
581        _value.setSortOrder(sortOrder);
582    }
583    
584    public boolean getSortOrderHasBeenModified() {
585        return _value.getSortOrderHasBeenModified();
586    }
587    
588    @Nonnull
589    public Long getFromTime() {
590        return _value.getFromTime();
591    }
592    
593    public void setFromTime(@Nonnull Long fromTime)
594            throws PersistenceNotNullException, PersistenceReadOnlyException {
595        checkReadWrite();
596        _value.setFromTime(fromTime);
597    }
598    
599    public boolean getFromTimeHasBeenModified() {
600        return _value.getFromTimeHasBeenModified();
601    }
602    
603    @Nonnull
604    public Long getThruTime() {
605        return _value.getThruTime();
606    }
607    
608    public void setThruTime(@Nonnull Long thruTime)
609            throws PersistenceNotNullException, PersistenceReadOnlyException {
610        checkReadWrite();
611        _value.setThruTime(thruTime);
612    }
613    
614    public boolean getThruTimeHasBeenModified() {
615        return _value.getThruTimeHasBeenModified();
616    }
617    
618}