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