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 * OrderShipmentGroupDetailValue.java
021 */
022
023package com.echothree.model.data.order.server.value;
024
025import com.echothree.model.data.order.common.pk.OrderShipmentGroupDetailPK;
026
027import com.echothree.model.data.order.server.factory.OrderShipmentGroupDetailFactory;
028
029import com.echothree.model.data.order.common.pk.OrderShipmentGroupPK;
030import com.echothree.model.data.order.common.pk.OrderPK;
031import com.echothree.model.data.item.common.pk.ItemDeliveryTypePK;
032import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
033import com.echothree.model.data.shipping.common.pk.ShippingMethodPK;
034
035import com.echothree.util.common.exception.PersistenceCloneException;
036import com.echothree.util.common.exception.PersistenceNotNullException;
037
038import com.echothree.util.server.persistence.BaseValue;
039
040import java.io.Serializable;
041
042import javax.annotation.Nonnull;
043import javax.annotation.Nullable;
044
045public class OrderShipmentGroupDetailValue
046        extends BaseValue<OrderShipmentGroupDetailPK>
047        implements Cloneable, Serializable {
048    
049    private OrderShipmentGroupPK orderShipmentGroupPK;
050    private boolean orderShipmentGroupPKHasBeenModified = false;
051    private OrderPK orderPK;
052    private boolean orderPKHasBeenModified = false;
053    private Integer orderShipmentGroupSequence;
054    private boolean orderShipmentGroupSequenceHasBeenModified = false;
055    private ItemDeliveryTypePK itemDeliveryTypePK;
056    private boolean itemDeliveryTypePKHasBeenModified = false;
057    private Boolean isDefault;
058    private boolean isDefaultHasBeenModified = false;
059    private PartyContactMechanismPK partyContactMechanismPK;
060    private boolean partyContactMechanismPKHasBeenModified = false;
061    private ShippingMethodPK shippingMethodPK;
062    private boolean shippingMethodPKHasBeenModified = false;
063    private Boolean holdUntilComplete;
064    private boolean holdUntilCompleteHasBeenModified = false;
065    private Long fromTime;
066    private boolean fromTimeHasBeenModified = false;
067    private Long thruTime;
068    private boolean thruTimeHasBeenModified = false;
069    
070    private transient Integer _hashCode = null;
071    private transient String _stringValue = null;
072    
073    private void constructFields(OrderShipmentGroupPK orderShipmentGroupPK, OrderPK orderPK, Integer orderShipmentGroupSequence, ItemDeliveryTypePK itemDeliveryTypePK, Boolean isDefault, PartyContactMechanismPK partyContactMechanismPK, ShippingMethodPK shippingMethodPK, Boolean holdUntilComplete, Long fromTime, Long thruTime)
074            throws PersistenceNotNullException {
075        checkForNull(orderShipmentGroupPK);
076        this.orderShipmentGroupPK = orderShipmentGroupPK;
077        checkForNull(orderPK);
078        this.orderPK = orderPK;
079        checkForNull(orderShipmentGroupSequence);
080        this.orderShipmentGroupSequence = orderShipmentGroupSequence;
081        checkForNull(itemDeliveryTypePK);
082        this.itemDeliveryTypePK = itemDeliveryTypePK;
083        checkForNull(isDefault);
084        this.isDefault = isDefault;
085        this.partyContactMechanismPK = partyContactMechanismPK;
086        this.shippingMethodPK = shippingMethodPK;
087        this.holdUntilComplete = holdUntilComplete;
088        checkForNull(fromTime);
089        this.fromTime = fromTime;
090        checkForNull(thruTime);
091        this.thruTime = thruTime;
092    }
093    
094    /** Creates a new instance of OrderShipmentGroupDetailValue */
095    public OrderShipmentGroupDetailValue(OrderShipmentGroupDetailPK orderShipmentGroupDetailPK, OrderShipmentGroupPK orderShipmentGroupPK, OrderPK orderPK, Integer orderShipmentGroupSequence, ItemDeliveryTypePK itemDeliveryTypePK, Boolean isDefault, PartyContactMechanismPK partyContactMechanismPK, ShippingMethodPK shippingMethodPK, Boolean holdUntilComplete, Long fromTime, Long thruTime)
096            throws PersistenceNotNullException {
097        super(orderShipmentGroupDetailPK);
098        constructFields(orderShipmentGroupPK, orderPK, orderShipmentGroupSequence, itemDeliveryTypePK, isDefault, partyContactMechanismPK, shippingMethodPK, holdUntilComplete, fromTime, thruTime);
099    }
100    
101    /** Creates a new instance of OrderShipmentGroupDetailValue */
102    public OrderShipmentGroupDetailValue(OrderShipmentGroupPK orderShipmentGroupPK, OrderPK orderPK, Integer orderShipmentGroupSequence, ItemDeliveryTypePK itemDeliveryTypePK, Boolean isDefault, PartyContactMechanismPK partyContactMechanismPK, ShippingMethodPK shippingMethodPK, Boolean holdUntilComplete, Long fromTime, Long thruTime)
103            throws PersistenceNotNullException {
104        super();
105        constructFields(orderShipmentGroupPK, orderPK, orderShipmentGroupSequence, itemDeliveryTypePK, isDefault, partyContactMechanismPK, shippingMethodPK, holdUntilComplete, fromTime, thruTime);
106    }
107    
108    @Override
109    @Nonnull
110    public OrderShipmentGroupDetailFactory getBaseFactoryInstance() {
111        return OrderShipmentGroupDetailFactory.getInstance();
112    }
113    
114    @Override
115    @Nonnull
116    public OrderShipmentGroupDetailValue clone() {
117        Object result;
118        
119        try {
120            result = super.clone();
121        } catch (CloneNotSupportedException cnse) {
122            // This shouldn't happen, fail when it does.
123            throw new PersistenceCloneException(cnse);
124        }
125        
126        return (OrderShipmentGroupDetailValue)result;
127    }
128    
129    @Override
130    @Nonnull
131    public OrderShipmentGroupDetailPK getPrimaryKey() {
132        if(_primaryKey == null) {
133            _primaryKey = new OrderShipmentGroupDetailPK(entityId);
134        }
135        
136        return _primaryKey;
137    }
138    
139    private void clearHashAndString() {
140        _hashCode = null;
141        _stringValue = null;
142    }
143    
144    @Override
145    public int hashCode() {
146        if(_hashCode == null) {
147            int hashCode = 17;
148            
149            hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0);
150            
151            hashCode = 37 * hashCode + ((orderShipmentGroupPK != null) ? orderShipmentGroupPK.hashCode() : 0);
152            hashCode = 37 * hashCode + ((orderPK != null) ? orderPK.hashCode() : 0);
153            hashCode = 37 * hashCode + ((orderShipmentGroupSequence != null) ? orderShipmentGroupSequence.hashCode() : 0);
154            hashCode = 37 * hashCode + ((itemDeliveryTypePK != null) ? itemDeliveryTypePK.hashCode() : 0);
155            hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0);
156            hashCode = 37 * hashCode + ((partyContactMechanismPK != null) ? partyContactMechanismPK.hashCode() : 0);
157            hashCode = 37 * hashCode + ((shippingMethodPK != null) ? shippingMethodPK.hashCode() : 0);
158            hashCode = 37 * hashCode + ((holdUntilComplete != null) ? holdUntilComplete.hashCode() : 0);
159            hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0);
160            hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0);
161            
162            _hashCode = hashCode;
163        }
164        
165        return _hashCode;
166    }
167    
168    @Override
169    @Nonnull
170    public String toString() {
171        if(_stringValue == null) {
172            _stringValue = "{" + 
173                    "entityId=" + getEntityId() +
174                    ", orderShipmentGroupPK=" + getOrderShipmentGroupPK() +
175                    ", orderPK=" + getOrderPK() +
176                    ", orderShipmentGroupSequence=" + getOrderShipmentGroupSequence() +
177                    ", itemDeliveryTypePK=" + getItemDeliveryTypePK() +
178                    ", isDefault=" + getIsDefault() +
179                    ", partyContactMechanismPK=" + getPartyContactMechanismPK() +
180                    ", shippingMethodPK=" + getShippingMethodPK() +
181                    ", holdUntilComplete=" + getHoldUntilComplete() +
182                    ", fromTime=" + getFromTime() +
183                    ", thruTime=" + getThruTime() +
184                    "}";
185        }
186        return _stringValue;
187    }
188    
189    @Override
190    public boolean equals(Object other) {
191        if(this == other)
192            return true;
193        
194        if(!hasIdentity())
195            return false;
196        
197        if(other instanceof  OrderShipmentGroupDetailValue that) {
198            if(!that.hasIdentity())
199                return false;
200            
201            Long thisEntityId = getEntityId();
202            Long thatEntityId = that.getEntityId();
203            
204            boolean objectsEqual = thisEntityId.equals(thatEntityId);
205            if(objectsEqual)
206                objectsEqual = isIdentical(that);
207            
208            return objectsEqual;
209        } else {
210            return false;
211        }
212    }
213    
214    public boolean isIdentical(Object other) {
215        if(other instanceof OrderShipmentGroupDetailValue that) {
216            boolean objectsEqual = true;
217            
218            
219            if(objectsEqual) {
220                OrderShipmentGroupPK thisOrderShipmentGroupPK = getOrderShipmentGroupPK();
221                OrderShipmentGroupPK thatOrderShipmentGroupPK = that.getOrderShipmentGroupPK();
222                
223                if(thisOrderShipmentGroupPK == null) {
224                    objectsEqual = objectsEqual && (thatOrderShipmentGroupPK == null);
225                } else {
226                    objectsEqual = objectsEqual && thisOrderShipmentGroupPK.equals(thatOrderShipmentGroupPK);
227                }
228            }
229            
230            if(objectsEqual) {
231                OrderPK thisOrderPK = getOrderPK();
232                OrderPK thatOrderPK = that.getOrderPK();
233                
234                if(thisOrderPK == null) {
235                    objectsEqual = objectsEqual && (thatOrderPK == null);
236                } else {
237                    objectsEqual = objectsEqual && thisOrderPK.equals(thatOrderPK);
238                }
239            }
240            
241            if(objectsEqual) {
242                Integer thisOrderShipmentGroupSequence = getOrderShipmentGroupSequence();
243                Integer thatOrderShipmentGroupSequence = that.getOrderShipmentGroupSequence();
244                
245                if(thisOrderShipmentGroupSequence == null) {
246                    objectsEqual = objectsEqual && (thatOrderShipmentGroupSequence == null);
247                } else {
248                    objectsEqual = objectsEqual && thisOrderShipmentGroupSequence.equals(thatOrderShipmentGroupSequence);
249                }
250            }
251            
252            if(objectsEqual) {
253                ItemDeliveryTypePK thisItemDeliveryTypePK = getItemDeliveryTypePK();
254                ItemDeliveryTypePK thatItemDeliveryTypePK = that.getItemDeliveryTypePK();
255                
256                if(thisItemDeliveryTypePK == null) {
257                    objectsEqual = objectsEqual && (thatItemDeliveryTypePK == null);
258                } else {
259                    objectsEqual = objectsEqual && thisItemDeliveryTypePK.equals(thatItemDeliveryTypePK);
260                }
261            }
262            
263            if(objectsEqual) {
264                Boolean thisIsDefault = getIsDefault();
265                Boolean thatIsDefault = that.getIsDefault();
266                
267                if(thisIsDefault == null) {
268                    objectsEqual = objectsEqual && (thatIsDefault == null);
269                } else {
270                    objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault);
271                }
272            }
273            
274            if(objectsEqual) {
275                PartyContactMechanismPK thisPartyContactMechanismPK = getPartyContactMechanismPK();
276                PartyContactMechanismPK thatPartyContactMechanismPK = that.getPartyContactMechanismPK();
277                
278                if(thisPartyContactMechanismPK == null) {
279                    objectsEqual = objectsEqual && (thatPartyContactMechanismPK == null);
280                } else {
281                    objectsEqual = objectsEqual && thisPartyContactMechanismPK.equals(thatPartyContactMechanismPK);
282                }
283            }
284            
285            if(objectsEqual) {
286                ShippingMethodPK thisShippingMethodPK = getShippingMethodPK();
287                ShippingMethodPK thatShippingMethodPK = that.getShippingMethodPK();
288                
289                if(thisShippingMethodPK == null) {
290                    objectsEqual = objectsEqual && (thatShippingMethodPK == null);
291                } else {
292                    objectsEqual = objectsEqual && thisShippingMethodPK.equals(thatShippingMethodPK);
293                }
294            }
295            
296            if(objectsEqual) {
297                Boolean thisHoldUntilComplete = getHoldUntilComplete();
298                Boolean thatHoldUntilComplete = that.getHoldUntilComplete();
299                
300                if(thisHoldUntilComplete == null) {
301                    objectsEqual = objectsEqual && (thatHoldUntilComplete == null);
302                } else {
303                    objectsEqual = objectsEqual && thisHoldUntilComplete.equals(thatHoldUntilComplete);
304                }
305            }
306            
307            if(objectsEqual) {
308                Long thisFromTime = getFromTime();
309                Long thatFromTime = that.getFromTime();
310                
311                if(thisFromTime == null) {
312                    objectsEqual = objectsEqual && (thatFromTime == null);
313                } else {
314                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
315                }
316            }
317            
318            if(objectsEqual) {
319                Long thisThruTime = getThruTime();
320                Long thatThruTime = that.getThruTime();
321                
322                if(thisThruTime == null) {
323                    objectsEqual = objectsEqual && (thatThruTime == null);
324                } else {
325                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
326                }
327            }
328            
329            return objectsEqual;
330        } else {
331            return false;
332        }
333    }
334    
335    @Override
336    public boolean hasBeenModified() {
337        return orderShipmentGroupPKHasBeenModified || orderPKHasBeenModified || orderShipmentGroupSequenceHasBeenModified || itemDeliveryTypePKHasBeenModified || isDefaultHasBeenModified || partyContactMechanismPKHasBeenModified || shippingMethodPKHasBeenModified || holdUntilCompleteHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
338    }
339    
340    @Override
341    public void clearHasBeenModified() {
342        orderShipmentGroupPKHasBeenModified = false;
343        orderPKHasBeenModified = false;
344        orderShipmentGroupSequenceHasBeenModified = false;
345        itemDeliveryTypePKHasBeenModified = false;
346        isDefaultHasBeenModified = false;
347        partyContactMechanismPKHasBeenModified = false;
348        shippingMethodPKHasBeenModified = false;
349        holdUntilCompleteHasBeenModified = false;
350        fromTimeHasBeenModified = false;
351        thruTimeHasBeenModified = false;
352    }
353    
354    @Nonnull
355    public OrderShipmentGroupPK getOrderShipmentGroupPK() {
356        return orderShipmentGroupPK;
357    }
358    
359    public void setOrderShipmentGroupPK(@Nonnull OrderShipmentGroupPK orderShipmentGroupPK)
360            throws PersistenceNotNullException {
361        checkForNull(orderShipmentGroupPK);
362        
363        boolean update = true;
364        
365        if(this.orderShipmentGroupPK != null) {
366            if(this.orderShipmentGroupPK.equals(orderShipmentGroupPK)) {
367                update = false;
368            }
369        } else if(orderShipmentGroupPK == null) {
370            update = false;
371        }
372        
373        if(update) {
374            this.orderShipmentGroupPK = orderShipmentGroupPK;
375            orderShipmentGroupPKHasBeenModified = true;
376            clearHashAndString();
377        }
378    }
379    
380    public boolean getOrderShipmentGroupPKHasBeenModified() {
381        return orderShipmentGroupPKHasBeenModified;
382    }
383    
384    @Nonnull
385    public OrderPK getOrderPK() {
386        return orderPK;
387    }
388    
389    public void setOrderPK(@Nonnull OrderPK orderPK)
390            throws PersistenceNotNullException {
391        checkForNull(orderPK);
392        
393        boolean update = true;
394        
395        if(this.orderPK != null) {
396            if(this.orderPK.equals(orderPK)) {
397                update = false;
398            }
399        } else if(orderPK == null) {
400            update = false;
401        }
402        
403        if(update) {
404            this.orderPK = orderPK;
405            orderPKHasBeenModified = true;
406            clearHashAndString();
407        }
408    }
409    
410    public boolean getOrderPKHasBeenModified() {
411        return orderPKHasBeenModified;
412    }
413    
414    @Nonnull
415    public Integer getOrderShipmentGroupSequence() {
416        return orderShipmentGroupSequence;
417    }
418    
419    public void setOrderShipmentGroupSequence(@Nonnull Integer orderShipmentGroupSequence)
420            throws PersistenceNotNullException {
421        checkForNull(orderShipmentGroupSequence);
422        
423        boolean update = true;
424        
425        if(this.orderShipmentGroupSequence != null) {
426            if(this.orderShipmentGroupSequence.equals(orderShipmentGroupSequence)) {
427                update = false;
428            }
429        } else if(orderShipmentGroupSequence == null) {
430            update = false;
431        }
432        
433        if(update) {
434            this.orderShipmentGroupSequence = orderShipmentGroupSequence;
435            orderShipmentGroupSequenceHasBeenModified = true;
436            clearHashAndString();
437        }
438    }
439    
440    public boolean getOrderShipmentGroupSequenceHasBeenModified() {
441        return orderShipmentGroupSequenceHasBeenModified;
442    }
443    
444    @Nonnull
445    public ItemDeliveryTypePK getItemDeliveryTypePK() {
446        return itemDeliveryTypePK;
447    }
448    
449    public void setItemDeliveryTypePK(@Nonnull ItemDeliveryTypePK itemDeliveryTypePK)
450            throws PersistenceNotNullException {
451        checkForNull(itemDeliveryTypePK);
452        
453        boolean update = true;
454        
455        if(this.itemDeliveryTypePK != null) {
456            if(this.itemDeliveryTypePK.equals(itemDeliveryTypePK)) {
457                update = false;
458            }
459        } else if(itemDeliveryTypePK == null) {
460            update = false;
461        }
462        
463        if(update) {
464            this.itemDeliveryTypePK = itemDeliveryTypePK;
465            itemDeliveryTypePKHasBeenModified = true;
466            clearHashAndString();
467        }
468    }
469    
470    public boolean getItemDeliveryTypePKHasBeenModified() {
471        return itemDeliveryTypePKHasBeenModified;
472    }
473    
474    @Nonnull
475    public Boolean getIsDefault() {
476        return isDefault;
477    }
478    
479    public void setIsDefault(@Nonnull Boolean isDefault)
480            throws PersistenceNotNullException {
481        checkForNull(isDefault);
482        
483        boolean update = true;
484        
485        if(this.isDefault != null) {
486            if(this.isDefault.equals(isDefault)) {
487                update = false;
488            }
489        } else if(isDefault == null) {
490            update = false;
491        }
492        
493        if(update) {
494            this.isDefault = isDefault;
495            isDefaultHasBeenModified = true;
496            clearHashAndString();
497        }
498    }
499    
500    public boolean getIsDefaultHasBeenModified() {
501        return isDefaultHasBeenModified;
502    }
503    
504    @Nullable
505    public PartyContactMechanismPK getPartyContactMechanismPK() {
506        return partyContactMechanismPK;
507    }
508    
509    public void setPartyContactMechanismPK(@Nullable PartyContactMechanismPK partyContactMechanismPK) {
510        boolean update = true;
511        
512        if(this.partyContactMechanismPK != null) {
513            if(this.partyContactMechanismPK.equals(partyContactMechanismPK)) {
514                update = false;
515            }
516        } else if(partyContactMechanismPK == null) {
517            update = false;
518        }
519        
520        if(update) {
521            this.partyContactMechanismPK = partyContactMechanismPK;
522            partyContactMechanismPKHasBeenModified = true;
523            clearHashAndString();
524        }
525    }
526    
527    public boolean getPartyContactMechanismPKHasBeenModified() {
528        return partyContactMechanismPKHasBeenModified;
529    }
530    
531    @Nullable
532    public ShippingMethodPK getShippingMethodPK() {
533        return shippingMethodPK;
534    }
535    
536    public void setShippingMethodPK(@Nullable ShippingMethodPK shippingMethodPK) {
537        boolean update = true;
538        
539        if(this.shippingMethodPK != null) {
540            if(this.shippingMethodPK.equals(shippingMethodPK)) {
541                update = false;
542            }
543        } else if(shippingMethodPK == null) {
544            update = false;
545        }
546        
547        if(update) {
548            this.shippingMethodPK = shippingMethodPK;
549            shippingMethodPKHasBeenModified = true;
550            clearHashAndString();
551        }
552    }
553    
554    public boolean getShippingMethodPKHasBeenModified() {
555        return shippingMethodPKHasBeenModified;
556    }
557    
558    @Nullable
559    public Boolean getHoldUntilComplete() {
560        return holdUntilComplete;
561    }
562    
563    public void setHoldUntilComplete(@Nullable Boolean holdUntilComplete) {
564        boolean update = true;
565        
566        if(this.holdUntilComplete != null) {
567            if(this.holdUntilComplete.equals(holdUntilComplete)) {
568                update = false;
569            }
570        } else if(holdUntilComplete == null) {
571            update = false;
572        }
573        
574        if(update) {
575            this.holdUntilComplete = holdUntilComplete;
576            holdUntilCompleteHasBeenModified = true;
577            clearHashAndString();
578        }
579    }
580    
581    public boolean getHoldUntilCompleteHasBeenModified() {
582        return holdUntilCompleteHasBeenModified;
583    }
584    
585    @Nonnull
586    public Long getFromTime() {
587        return fromTime;
588    }
589    
590    public void setFromTime(@Nonnull Long fromTime)
591            throws PersistenceNotNullException {
592        checkForNull(fromTime);
593        
594        boolean update = true;
595        
596        if(this.fromTime != null) {
597            if(this.fromTime.equals(fromTime)) {
598                update = false;
599            }
600        } else if(fromTime == null) {
601            update = false;
602        }
603        
604        if(update) {
605            this.fromTime = fromTime;
606            fromTimeHasBeenModified = true;
607            clearHashAndString();
608        }
609    }
610    
611    public boolean getFromTimeHasBeenModified() {
612        return fromTimeHasBeenModified;
613    }
614    
615    @Nonnull
616    public Long getThruTime() {
617        return thruTime;
618    }
619    
620    public void setThruTime(@Nonnull Long thruTime)
621            throws PersistenceNotNullException {
622        checkForNull(thruTime);
623        
624        boolean update = true;
625        
626        if(this.thruTime != null) {
627            if(this.thruTime.equals(thruTime)) {
628                update = false;
629            }
630        } else if(thruTime == null) {
631            update = false;
632        }
633        
634        if(update) {
635            this.thruTime = thruTime;
636            thruTimeHasBeenModified = true;
637            clearHashAndString();
638        }
639    }
640    
641    public boolean getThruTimeHasBeenModified() {
642        return thruTimeHasBeenModified;
643    }
644    
645}