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 * AssociateProgramDetailValue.java 021 */ 022 023package com.echothree.model.data.associate.server.value; 024 025import com.echothree.model.data.associate.common.pk.AssociateProgramDetailPK; 026 027import com.echothree.model.data.associate.server.factory.AssociateProgramDetailFactory; 028 029import com.echothree.model.data.associate.common.pk.AssociateProgramPK; 030import com.echothree.model.data.sequence.common.pk.SequencePK; 031 032import com.echothree.util.common.exception.PersistenceCloneException; 033import com.echothree.util.common.exception.PersistenceNotNullException; 034 035import com.echothree.util.server.persistence.BaseValue; 036 037import java.io.Serializable; 038 039import javax.annotation.Nonnull; 040import javax.annotation.Nullable; 041 042public class AssociateProgramDetailValue 043 extends BaseValue<AssociateProgramDetailPK> 044 implements Cloneable, Serializable { 045 046 private AssociateProgramPK associateProgramPK; 047 private boolean associateProgramPKHasBeenModified = false; 048 private String associateProgramName; 049 private boolean associateProgramNameHasBeenModified = false; 050 private SequencePK associateSequencePK; 051 private boolean associateSequencePKHasBeenModified = false; 052 private SequencePK associatePartyContactMechanismSequencePK; 053 private boolean associatePartyContactMechanismSequencePKHasBeenModified = false; 054 private SequencePK associateReferralSequencePK; 055 private boolean associateReferralSequencePKHasBeenModified = false; 056 private Integer itemIndirectSalePercent; 057 private boolean itemIndirectSalePercentHasBeenModified = false; 058 private Integer itemDirectSalePercent; 059 private boolean itemDirectSalePercentHasBeenModified = false; 060 private Boolean isDefault; 061 private boolean isDefaultHasBeenModified = false; 062 private Integer sortOrder; 063 private boolean sortOrderHasBeenModified = false; 064 private Long fromTime; 065 private boolean fromTimeHasBeenModified = false; 066 private Long thruTime; 067 private boolean thruTimeHasBeenModified = false; 068 069 private transient Integer _hashCode = null; 070 private transient String _stringValue = null; 071 072 private void constructFields(AssociateProgramPK associateProgramPK, String associateProgramName, SequencePK associateSequencePK, SequencePK associatePartyContactMechanismSequencePK, SequencePK associateReferralSequencePK, Integer itemIndirectSalePercent, Integer itemDirectSalePercent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 073 throws PersistenceNotNullException { 074 this.associateProgramPK = associateProgramPK; 075 checkForNull(associateProgramName); 076 this.associateProgramName = associateProgramName; 077 this.associateSequencePK = associateSequencePK; 078 this.associatePartyContactMechanismSequencePK = associatePartyContactMechanismSequencePK; 079 this.associateReferralSequencePK = associateReferralSequencePK; 080 this.itemIndirectSalePercent = itemIndirectSalePercent; 081 this.itemDirectSalePercent = itemDirectSalePercent; 082 checkForNull(isDefault); 083 this.isDefault = isDefault; 084 checkForNull(sortOrder); 085 this.sortOrder = sortOrder; 086 checkForNull(fromTime); 087 this.fromTime = fromTime; 088 checkForNull(thruTime); 089 this.thruTime = thruTime; 090 } 091 092 /** Creates a new instance of AssociateProgramDetailValue */ 093 public AssociateProgramDetailValue(AssociateProgramDetailPK associateProgramDetailPK, AssociateProgramPK associateProgramPK, String associateProgramName, SequencePK associateSequencePK, SequencePK associatePartyContactMechanismSequencePK, SequencePK associateReferralSequencePK, Integer itemIndirectSalePercent, Integer itemDirectSalePercent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 094 throws PersistenceNotNullException { 095 super(associateProgramDetailPK); 096 constructFields(associateProgramPK, associateProgramName, associateSequencePK, associatePartyContactMechanismSequencePK, associateReferralSequencePK, itemIndirectSalePercent, itemDirectSalePercent, isDefault, sortOrder, fromTime, thruTime); 097 } 098 099 /** Creates a new instance of AssociateProgramDetailValue */ 100 public AssociateProgramDetailValue(AssociateProgramPK associateProgramPK, String associateProgramName, SequencePK associateSequencePK, SequencePK associatePartyContactMechanismSequencePK, SequencePK associateReferralSequencePK, Integer itemIndirectSalePercent, Integer itemDirectSalePercent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 101 throws PersistenceNotNullException { 102 super(); 103 constructFields(associateProgramPK, associateProgramName, associateSequencePK, associatePartyContactMechanismSequencePK, associateReferralSequencePK, itemIndirectSalePercent, itemDirectSalePercent, isDefault, sortOrder, fromTime, thruTime); 104 } 105 106 @Override 107 @Nonnull 108 public AssociateProgramDetailFactory getBaseFactoryInstance() { 109 return AssociateProgramDetailFactory.getInstance(); 110 } 111 112 @Override 113 @Nonnull 114 public AssociateProgramDetailValue clone() { 115 Object result; 116 117 try { 118 result = super.clone(); 119 } catch (CloneNotSupportedException cnse) { 120 // This shouldn't happen, fail when it does. 121 throw new PersistenceCloneException(cnse); 122 } 123 124 return (AssociateProgramDetailValue)result; 125 } 126 127 @Override 128 @Nonnull 129 public AssociateProgramDetailPK getPrimaryKey() { 130 if(_primaryKey == null) { 131 _primaryKey = new AssociateProgramDetailPK(entityId); 132 } 133 134 return _primaryKey; 135 } 136 137 private void clearHashAndString() { 138 _hashCode = null; 139 _stringValue = null; 140 } 141 142 @Override 143 public int hashCode() { 144 if(_hashCode == null) { 145 int hashCode = 17; 146 147 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 148 149 hashCode = 37 * hashCode + ((associateProgramPK != null) ? associateProgramPK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((associateProgramName != null) ? associateProgramName.hashCode() : 0); 151 hashCode = 37 * hashCode + ((associateSequencePK != null) ? associateSequencePK.hashCode() : 0); 152 hashCode = 37 * hashCode + ((associatePartyContactMechanismSequencePK != null) ? associatePartyContactMechanismSequencePK.hashCode() : 0); 153 hashCode = 37 * hashCode + ((associateReferralSequencePK != null) ? associateReferralSequencePK.hashCode() : 0); 154 hashCode = 37 * hashCode + ((itemIndirectSalePercent != null) ? itemIndirectSalePercent.hashCode() : 0); 155 hashCode = 37 * hashCode + ((itemDirectSalePercent != null) ? itemDirectSalePercent.hashCode() : 0); 156 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 157 hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.hashCode() : 0); 158 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 159 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 160 161 _hashCode = hashCode; 162 } 163 164 return _hashCode; 165 } 166 167 @Override 168 @Nonnull 169 public String toString() { 170 if(_stringValue == null) { 171 _stringValue = "{" + 172 "entityId=" + getEntityId() + 173 ", associateProgramPK=" + getAssociateProgramPK() + 174 ", associateProgramName=" + getAssociateProgramName() + 175 ", associateSequencePK=" + getAssociateSequencePK() + 176 ", associatePartyContactMechanismSequencePK=" + getAssociatePartyContactMechanismSequencePK() + 177 ", associateReferralSequencePK=" + getAssociateReferralSequencePK() + 178 ", itemIndirectSalePercent=" + getItemIndirectSalePercent() + 179 ", itemDirectSalePercent=" + getItemDirectSalePercent() + 180 ", isDefault=" + getIsDefault() + 181 ", sortOrder=" + getSortOrder() + 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 AssociateProgramDetailValue 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 AssociateProgramDetailValue that) { 216 boolean objectsEqual = true; 217 218 219 if(objectsEqual) { 220 AssociateProgramPK thisAssociateProgramPK = getAssociateProgramPK(); 221 AssociateProgramPK thatAssociateProgramPK = that.getAssociateProgramPK(); 222 223 if(thisAssociateProgramPK == null) { 224 objectsEqual = objectsEqual && (thatAssociateProgramPK == null); 225 } else { 226 objectsEqual = objectsEqual && thisAssociateProgramPK.equals(thatAssociateProgramPK); 227 } 228 } 229 230 if(objectsEqual) { 231 String thisAssociateProgramName = getAssociateProgramName(); 232 String thatAssociateProgramName = that.getAssociateProgramName(); 233 234 if(thisAssociateProgramName == null) { 235 objectsEqual = objectsEqual && (thatAssociateProgramName == null); 236 } else { 237 objectsEqual = objectsEqual && thisAssociateProgramName.equals(thatAssociateProgramName); 238 } 239 } 240 241 if(objectsEqual) { 242 SequencePK thisAssociateSequencePK = getAssociateSequencePK(); 243 SequencePK thatAssociateSequencePK = that.getAssociateSequencePK(); 244 245 if(thisAssociateSequencePK == null) { 246 objectsEqual = objectsEqual && (thatAssociateSequencePK == null); 247 } else { 248 objectsEqual = objectsEqual && thisAssociateSequencePK.equals(thatAssociateSequencePK); 249 } 250 } 251 252 if(objectsEqual) { 253 SequencePK thisAssociatePartyContactMechanismSequencePK = getAssociatePartyContactMechanismSequencePK(); 254 SequencePK thatAssociatePartyContactMechanismSequencePK = that.getAssociatePartyContactMechanismSequencePK(); 255 256 if(thisAssociatePartyContactMechanismSequencePK == null) { 257 objectsEqual = objectsEqual && (thatAssociatePartyContactMechanismSequencePK == null); 258 } else { 259 objectsEqual = objectsEqual && thisAssociatePartyContactMechanismSequencePK.equals(thatAssociatePartyContactMechanismSequencePK); 260 } 261 } 262 263 if(objectsEqual) { 264 SequencePK thisAssociateReferralSequencePK = getAssociateReferralSequencePK(); 265 SequencePK thatAssociateReferralSequencePK = that.getAssociateReferralSequencePK(); 266 267 if(thisAssociateReferralSequencePK == null) { 268 objectsEqual = objectsEqual && (thatAssociateReferralSequencePK == null); 269 } else { 270 objectsEqual = objectsEqual && thisAssociateReferralSequencePK.equals(thatAssociateReferralSequencePK); 271 } 272 } 273 274 if(objectsEqual) { 275 Integer thisItemIndirectSalePercent = getItemIndirectSalePercent(); 276 Integer thatItemIndirectSalePercent = that.getItemIndirectSalePercent(); 277 278 if(thisItemIndirectSalePercent == null) { 279 objectsEqual = objectsEqual && (thatItemIndirectSalePercent == null); 280 } else { 281 objectsEqual = objectsEqual && thisItemIndirectSalePercent.equals(thatItemIndirectSalePercent); 282 } 283 } 284 285 if(objectsEqual) { 286 Integer thisItemDirectSalePercent = getItemDirectSalePercent(); 287 Integer thatItemDirectSalePercent = that.getItemDirectSalePercent(); 288 289 if(thisItemDirectSalePercent == null) { 290 objectsEqual = objectsEqual && (thatItemDirectSalePercent == null); 291 } else { 292 objectsEqual = objectsEqual && thisItemDirectSalePercent.equals(thatItemDirectSalePercent); 293 } 294 } 295 296 if(objectsEqual) { 297 Boolean thisIsDefault = getIsDefault(); 298 Boolean thatIsDefault = that.getIsDefault(); 299 300 if(thisIsDefault == null) { 301 objectsEqual = objectsEqual && (thatIsDefault == null); 302 } else { 303 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 304 } 305 } 306 307 if(objectsEqual) { 308 Integer thisSortOrder = getSortOrder(); 309 Integer thatSortOrder = that.getSortOrder(); 310 311 if(thisSortOrder == null) { 312 objectsEqual = objectsEqual && (thatSortOrder == null); 313 } else { 314 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 315 } 316 } 317 318 if(objectsEqual) { 319 Long thisFromTime = getFromTime(); 320 Long thatFromTime = that.getFromTime(); 321 322 if(thisFromTime == null) { 323 objectsEqual = objectsEqual && (thatFromTime == null); 324 } else { 325 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 326 } 327 } 328 329 if(objectsEqual) { 330 Long thisThruTime = getThruTime(); 331 Long thatThruTime = that.getThruTime(); 332 333 if(thisThruTime == null) { 334 objectsEqual = objectsEqual && (thatThruTime == null); 335 } else { 336 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 337 } 338 } 339 340 return objectsEqual; 341 } else { 342 return false; 343 } 344 } 345 346 @Override 347 public boolean hasBeenModified() { 348 return associateProgramPKHasBeenModified || associateProgramNameHasBeenModified || associateSequencePKHasBeenModified || associatePartyContactMechanismSequencePKHasBeenModified || associateReferralSequencePKHasBeenModified || itemIndirectSalePercentHasBeenModified || itemDirectSalePercentHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 349 } 350 351 @Override 352 public void clearHasBeenModified() { 353 associateProgramPKHasBeenModified = false; 354 associateProgramNameHasBeenModified = false; 355 associateSequencePKHasBeenModified = false; 356 associatePartyContactMechanismSequencePKHasBeenModified = false; 357 associateReferralSequencePKHasBeenModified = false; 358 itemIndirectSalePercentHasBeenModified = false; 359 itemDirectSalePercentHasBeenModified = false; 360 isDefaultHasBeenModified = false; 361 sortOrderHasBeenModified = false; 362 fromTimeHasBeenModified = false; 363 thruTimeHasBeenModified = false; 364 } 365 366 @Nullable 367 public AssociateProgramPK getAssociateProgramPK() { 368 return associateProgramPK; 369 } 370 371 public void setAssociateProgramPK(@Nullable AssociateProgramPK associateProgramPK) { 372 boolean update = true; 373 374 if(this.associateProgramPK != null) { 375 if(this.associateProgramPK.equals(associateProgramPK)) { 376 update = false; 377 } 378 } else if(associateProgramPK == null) { 379 update = false; 380 } 381 382 if(update) { 383 this.associateProgramPK = associateProgramPK; 384 associateProgramPKHasBeenModified = true; 385 clearHashAndString(); 386 } 387 } 388 389 public boolean getAssociateProgramPKHasBeenModified() { 390 return associateProgramPKHasBeenModified; 391 } 392 393 @Nonnull 394 public String getAssociateProgramName() { 395 return associateProgramName; 396 } 397 398 public void setAssociateProgramName(@Nonnull String associateProgramName) 399 throws PersistenceNotNullException { 400 checkForNull(associateProgramName); 401 402 boolean update = true; 403 404 if(this.associateProgramName != null) { 405 if(this.associateProgramName.equals(associateProgramName)) { 406 update = false; 407 } 408 } else if(associateProgramName == null) { 409 update = false; 410 } 411 412 if(update) { 413 this.associateProgramName = associateProgramName; 414 associateProgramNameHasBeenModified = true; 415 clearHashAndString(); 416 } 417 } 418 419 public boolean getAssociateProgramNameHasBeenModified() { 420 return associateProgramNameHasBeenModified; 421 } 422 423 @Nullable 424 public SequencePK getAssociateSequencePK() { 425 return associateSequencePK; 426 } 427 428 public void setAssociateSequencePK(@Nullable SequencePK associateSequencePK) { 429 boolean update = true; 430 431 if(this.associateSequencePK != null) { 432 if(this.associateSequencePK.equals(associateSequencePK)) { 433 update = false; 434 } 435 } else if(associateSequencePK == null) { 436 update = false; 437 } 438 439 if(update) { 440 this.associateSequencePK = associateSequencePK; 441 associateSequencePKHasBeenModified = true; 442 clearHashAndString(); 443 } 444 } 445 446 public boolean getAssociateSequencePKHasBeenModified() { 447 return associateSequencePKHasBeenModified; 448 } 449 450 @Nullable 451 public SequencePK getAssociatePartyContactMechanismSequencePK() { 452 return associatePartyContactMechanismSequencePK; 453 } 454 455 public void setAssociatePartyContactMechanismSequencePK(@Nullable SequencePK associatePartyContactMechanismSequencePK) { 456 boolean update = true; 457 458 if(this.associatePartyContactMechanismSequencePK != null) { 459 if(this.associatePartyContactMechanismSequencePK.equals(associatePartyContactMechanismSequencePK)) { 460 update = false; 461 } 462 } else if(associatePartyContactMechanismSequencePK == null) { 463 update = false; 464 } 465 466 if(update) { 467 this.associatePartyContactMechanismSequencePK = associatePartyContactMechanismSequencePK; 468 associatePartyContactMechanismSequencePKHasBeenModified = true; 469 clearHashAndString(); 470 } 471 } 472 473 public boolean getAssociatePartyContactMechanismSequencePKHasBeenModified() { 474 return associatePartyContactMechanismSequencePKHasBeenModified; 475 } 476 477 @Nullable 478 public SequencePK getAssociateReferralSequencePK() { 479 return associateReferralSequencePK; 480 } 481 482 public void setAssociateReferralSequencePK(@Nullable SequencePK associateReferralSequencePK) { 483 boolean update = true; 484 485 if(this.associateReferralSequencePK != null) { 486 if(this.associateReferralSequencePK.equals(associateReferralSequencePK)) { 487 update = false; 488 } 489 } else if(associateReferralSequencePK == null) { 490 update = false; 491 } 492 493 if(update) { 494 this.associateReferralSequencePK = associateReferralSequencePK; 495 associateReferralSequencePKHasBeenModified = true; 496 clearHashAndString(); 497 } 498 } 499 500 public boolean getAssociateReferralSequencePKHasBeenModified() { 501 return associateReferralSequencePKHasBeenModified; 502 } 503 504 @Nullable 505 public Integer getItemIndirectSalePercent() { 506 return itemIndirectSalePercent; 507 } 508 509 public void setItemIndirectSalePercent(@Nullable Integer itemIndirectSalePercent) { 510 boolean update = true; 511 512 if(this.itemIndirectSalePercent != null) { 513 if(this.itemIndirectSalePercent.equals(itemIndirectSalePercent)) { 514 update = false; 515 } 516 } else if(itemIndirectSalePercent == null) { 517 update = false; 518 } 519 520 if(update) { 521 this.itemIndirectSalePercent = itemIndirectSalePercent; 522 itemIndirectSalePercentHasBeenModified = true; 523 clearHashAndString(); 524 } 525 } 526 527 public boolean getItemIndirectSalePercentHasBeenModified() { 528 return itemIndirectSalePercentHasBeenModified; 529 } 530 531 @Nullable 532 public Integer getItemDirectSalePercent() { 533 return itemDirectSalePercent; 534 } 535 536 public void setItemDirectSalePercent(@Nullable Integer itemDirectSalePercent) { 537 boolean update = true; 538 539 if(this.itemDirectSalePercent != null) { 540 if(this.itemDirectSalePercent.equals(itemDirectSalePercent)) { 541 update = false; 542 } 543 } else if(itemDirectSalePercent == null) { 544 update = false; 545 } 546 547 if(update) { 548 this.itemDirectSalePercent = itemDirectSalePercent; 549 itemDirectSalePercentHasBeenModified = true; 550 clearHashAndString(); 551 } 552 } 553 554 public boolean getItemDirectSalePercentHasBeenModified() { 555 return itemDirectSalePercentHasBeenModified; 556 } 557 558 @Nonnull 559 public Boolean getIsDefault() { 560 return isDefault; 561 } 562 563 public void setIsDefault(@Nonnull Boolean isDefault) 564 throws PersistenceNotNullException { 565 checkForNull(isDefault); 566 567 boolean update = true; 568 569 if(this.isDefault != null) { 570 if(this.isDefault.equals(isDefault)) { 571 update = false; 572 } 573 } else if(isDefault == null) { 574 update = false; 575 } 576 577 if(update) { 578 this.isDefault = isDefault; 579 isDefaultHasBeenModified = true; 580 clearHashAndString(); 581 } 582 } 583 584 public boolean getIsDefaultHasBeenModified() { 585 return isDefaultHasBeenModified; 586 } 587 588 @Nonnull 589 public Integer getSortOrder() { 590 return sortOrder; 591 } 592 593 public void setSortOrder(@Nonnull Integer sortOrder) 594 throws PersistenceNotNullException { 595 checkForNull(sortOrder); 596 597 boolean update = true; 598 599 if(this.sortOrder != null) { 600 if(this.sortOrder.equals(sortOrder)) { 601 update = false; 602 } 603 } else if(sortOrder == null) { 604 update = false; 605 } 606 607 if(update) { 608 this.sortOrder = sortOrder; 609 sortOrderHasBeenModified = true; 610 clearHashAndString(); 611 } 612 } 613 614 public boolean getSortOrderHasBeenModified() { 615 return sortOrderHasBeenModified; 616 } 617 618 @Nonnull 619 public Long getFromTime() { 620 return fromTime; 621 } 622 623 public void setFromTime(@Nonnull Long fromTime) 624 throws PersistenceNotNullException { 625 checkForNull(fromTime); 626 627 boolean update = true; 628 629 if(this.fromTime != null) { 630 if(this.fromTime.equals(fromTime)) { 631 update = false; 632 } 633 } else if(fromTime == null) { 634 update = false; 635 } 636 637 if(update) { 638 this.fromTime = fromTime; 639 fromTimeHasBeenModified = true; 640 clearHashAndString(); 641 } 642 } 643 644 public boolean getFromTimeHasBeenModified() { 645 return fromTimeHasBeenModified; 646 } 647 648 @Nonnull 649 public Long getThruTime() { 650 return thruTime; 651 } 652 653 public void setThruTime(@Nonnull Long thruTime) 654 throws PersistenceNotNullException { 655 checkForNull(thruTime); 656 657 boolean update = true; 658 659 if(this.thruTime != null) { 660 if(this.thruTime.equals(thruTime)) { 661 update = false; 662 } 663 } else if(thruTime == null) { 664 update = false; 665 } 666 667 if(update) { 668 this.thruTime = thruTime; 669 thruTimeHasBeenModified = true; 670 clearHashAndString(); 671 } 672 } 673 674 public boolean getThruTimeHasBeenModified() { 675 return thruTimeHasBeenModified; 676 } 677 678}