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 * TaxDetailValue.java 021 */ 022 023package com.echothree.model.data.tax.server.value; 024 025import com.echothree.model.data.tax.common.pk.TaxDetailPK; 026 027import com.echothree.model.data.tax.server.factory.TaxDetailFactory; 028 029import com.echothree.model.data.tax.common.pk.TaxPK; 030import com.echothree.model.data.contact.common.pk.ContactMechanismPurposePK; 031import com.echothree.model.data.accounting.common.pk.GlAccountPK; 032 033import com.echothree.util.common.exception.PersistenceCloneException; 034import com.echothree.util.common.exception.PersistenceNotNullException; 035 036import com.echothree.util.server.persistence.BaseValue; 037 038import java.io.Serializable; 039 040public class TaxDetailValue 041 extends BaseValue<TaxDetailPK> 042 implements Cloneable, Serializable { 043 044 private TaxPK taxPK; 045 private boolean taxPKHasBeenModified = false; 046 private String taxName; 047 private boolean taxNameHasBeenModified = false; 048 private ContactMechanismPurposePK contactMechanismPurposePK; 049 private boolean contactMechanismPurposePKHasBeenModified = false; 050 private GlAccountPK glAccountPK; 051 private boolean glAccountPKHasBeenModified = false; 052 private Boolean includeShippingCharge; 053 private boolean includeShippingChargeHasBeenModified = false; 054 private Boolean includeProcessingCharge; 055 private boolean includeProcessingChargeHasBeenModified = false; 056 private Boolean includeInsuranceCharge; 057 private boolean includeInsuranceChargeHasBeenModified = false; 058 private Integer percent; 059 private boolean percentHasBeenModified = 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(TaxPK taxPK, String taxName, ContactMechanismPurposePK contactMechanismPurposePK, GlAccountPK glAccountPK, Boolean includeShippingCharge, Boolean includeProcessingCharge, Boolean includeInsuranceCharge, Integer percent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 073 throws PersistenceNotNullException { 074 checkForNull(taxPK); 075 this.taxPK = taxPK; 076 checkForNull(taxName); 077 this.taxName = taxName; 078 checkForNull(contactMechanismPurposePK); 079 this.contactMechanismPurposePK = contactMechanismPurposePK; 080 checkForNull(glAccountPK); 081 this.glAccountPK = glAccountPK; 082 checkForNull(includeShippingCharge); 083 this.includeShippingCharge = includeShippingCharge; 084 checkForNull(includeProcessingCharge); 085 this.includeProcessingCharge = includeProcessingCharge; 086 checkForNull(includeInsuranceCharge); 087 this.includeInsuranceCharge = includeInsuranceCharge; 088 checkForNull(percent); 089 this.percent = percent; 090 checkForNull(isDefault); 091 this.isDefault = isDefault; 092 checkForNull(sortOrder); 093 this.sortOrder = sortOrder; 094 checkForNull(fromTime); 095 this.fromTime = fromTime; 096 checkForNull(thruTime); 097 this.thruTime = thruTime; 098 } 099 100 /** Creates a new instance of TaxDetailValue */ 101 public TaxDetailValue(TaxDetailPK taxDetailPK, TaxPK taxPK, String taxName, ContactMechanismPurposePK contactMechanismPurposePK, GlAccountPK glAccountPK, Boolean includeShippingCharge, Boolean includeProcessingCharge, Boolean includeInsuranceCharge, Integer percent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 102 throws PersistenceNotNullException { 103 super(taxDetailPK); 104 constructFields(taxPK, taxName, contactMechanismPurposePK, glAccountPK, includeShippingCharge, includeProcessingCharge, includeInsuranceCharge, percent, isDefault, sortOrder, fromTime, thruTime); 105 } 106 107 /** Creates a new instance of TaxDetailValue */ 108 public TaxDetailValue(TaxPK taxPK, String taxName, ContactMechanismPurposePK contactMechanismPurposePK, GlAccountPK glAccountPK, Boolean includeShippingCharge, Boolean includeProcessingCharge, Boolean includeInsuranceCharge, Integer percent, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 109 throws PersistenceNotNullException { 110 super(); 111 constructFields(taxPK, taxName, contactMechanismPurposePK, glAccountPK, includeShippingCharge, includeProcessingCharge, includeInsuranceCharge, percent, isDefault, sortOrder, fromTime, thruTime); 112 } 113 114 @Override 115 public TaxDetailFactory getBaseFactoryInstance() { 116 return TaxDetailFactory.getInstance(); 117 } 118 119 @Override 120 public TaxDetailValue clone() { 121 Object result; 122 123 try { 124 result = super.clone(); 125 } catch (CloneNotSupportedException cnse) { 126 // This shouldn't happen, fail when it does. 127 throw new PersistenceCloneException(cnse); 128 } 129 130 return (TaxDetailValue)result; 131 } 132 133 @Override 134 public TaxDetailPK getPrimaryKey() { 135 if(_primaryKey == null) { 136 _primaryKey = new TaxDetailPK(entityId); 137 } 138 139 return _primaryKey; 140 } 141 142 private void clearHashAndString() { 143 _hashCode = null; 144 _stringValue = null; 145 } 146 147 @Override 148 public int hashCode() { 149 if(_hashCode == null) { 150 int hashCode = 17; 151 152 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 153 154 hashCode = 37 * hashCode + ((taxPK != null) ? taxPK.hashCode() : 0); 155 hashCode = 37 * hashCode + ((taxName != null) ? taxName.hashCode() : 0); 156 hashCode = 37 * hashCode + ((contactMechanismPurposePK != null) ? contactMechanismPurposePK.hashCode() : 0); 157 hashCode = 37 * hashCode + ((glAccountPK != null) ? glAccountPK.hashCode() : 0); 158 hashCode = 37 * hashCode + ((includeShippingCharge != null) ? includeShippingCharge.hashCode() : 0); 159 hashCode = 37 * hashCode + ((includeProcessingCharge != null) ? includeProcessingCharge.hashCode() : 0); 160 hashCode = 37 * hashCode + ((includeInsuranceCharge != null) ? includeInsuranceCharge.hashCode() : 0); 161 hashCode = 37 * hashCode + ((percent != null) ? percent.hashCode() : 0); 162 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 163 hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.hashCode() : 0); 164 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 165 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 166 167 _hashCode = hashCode; 168 } 169 170 return _hashCode; 171 } 172 173 @Override 174 public String toString() { 175 if(_stringValue == null) { 176 _stringValue = "{" + 177 "entityId=" + getEntityId() + 178 ", taxPK=" + getTaxPK() + 179 ", taxName=" + getTaxName() + 180 ", contactMechanismPurposePK=" + getContactMechanismPurposePK() + 181 ", glAccountPK=" + getGlAccountPK() + 182 ", includeShippingCharge=" + getIncludeShippingCharge() + 183 ", includeProcessingCharge=" + getIncludeProcessingCharge() + 184 ", includeInsuranceCharge=" + getIncludeInsuranceCharge() + 185 ", percent=" + getPercent() + 186 ", isDefault=" + getIsDefault() + 187 ", sortOrder=" + getSortOrder() + 188 ", fromTime=" + getFromTime() + 189 ", thruTime=" + getThruTime() + 190 "}"; 191 } 192 return _stringValue; 193 } 194 195 @Override 196 public boolean equals(Object other) { 197 if(this == other) 198 return true; 199 200 if(!hasIdentity()) 201 return false; 202 203 if(other instanceof TaxDetailValue that) { 204 if(!that.hasIdentity()) 205 return false; 206 207 Long thisEntityId = getEntityId(); 208 Long thatEntityId = that.getEntityId(); 209 210 boolean objectsEqual = thisEntityId.equals(thatEntityId); 211 if(objectsEqual) 212 objectsEqual = isIdentical(that); 213 214 return objectsEqual; 215 } else { 216 return false; 217 } 218 } 219 220 public boolean isIdentical(Object other) { 221 if(other instanceof TaxDetailValue that) { 222 boolean objectsEqual = true; 223 224 225 if(objectsEqual) { 226 TaxPK thisTaxPK = getTaxPK(); 227 TaxPK thatTaxPK = that.getTaxPK(); 228 229 if(thisTaxPK == null) { 230 objectsEqual = objectsEqual && (thatTaxPK == null); 231 } else { 232 objectsEqual = objectsEqual && thisTaxPK.equals(thatTaxPK); 233 } 234 } 235 236 if(objectsEqual) { 237 String thisTaxName = getTaxName(); 238 String thatTaxName = that.getTaxName(); 239 240 if(thisTaxName == null) { 241 objectsEqual = objectsEqual && (thatTaxName == null); 242 } else { 243 objectsEqual = objectsEqual && thisTaxName.equals(thatTaxName); 244 } 245 } 246 247 if(objectsEqual) { 248 ContactMechanismPurposePK thisContactMechanismPurposePK = getContactMechanismPurposePK(); 249 ContactMechanismPurposePK thatContactMechanismPurposePK = that.getContactMechanismPurposePK(); 250 251 if(thisContactMechanismPurposePK == null) { 252 objectsEqual = objectsEqual && (thatContactMechanismPurposePK == null); 253 } else { 254 objectsEqual = objectsEqual && thisContactMechanismPurposePK.equals(thatContactMechanismPurposePK); 255 } 256 } 257 258 if(objectsEqual) { 259 GlAccountPK thisGlAccountPK = getGlAccountPK(); 260 GlAccountPK thatGlAccountPK = that.getGlAccountPK(); 261 262 if(thisGlAccountPK == null) { 263 objectsEqual = objectsEqual && (thatGlAccountPK == null); 264 } else { 265 objectsEqual = objectsEqual && thisGlAccountPK.equals(thatGlAccountPK); 266 } 267 } 268 269 if(objectsEqual) { 270 Boolean thisIncludeShippingCharge = getIncludeShippingCharge(); 271 Boolean thatIncludeShippingCharge = that.getIncludeShippingCharge(); 272 273 if(thisIncludeShippingCharge == null) { 274 objectsEqual = objectsEqual && (thatIncludeShippingCharge == null); 275 } else { 276 objectsEqual = objectsEqual && thisIncludeShippingCharge.equals(thatIncludeShippingCharge); 277 } 278 } 279 280 if(objectsEqual) { 281 Boolean thisIncludeProcessingCharge = getIncludeProcessingCharge(); 282 Boolean thatIncludeProcessingCharge = that.getIncludeProcessingCharge(); 283 284 if(thisIncludeProcessingCharge == null) { 285 objectsEqual = objectsEqual && (thatIncludeProcessingCharge == null); 286 } else { 287 objectsEqual = objectsEqual && thisIncludeProcessingCharge.equals(thatIncludeProcessingCharge); 288 } 289 } 290 291 if(objectsEqual) { 292 Boolean thisIncludeInsuranceCharge = getIncludeInsuranceCharge(); 293 Boolean thatIncludeInsuranceCharge = that.getIncludeInsuranceCharge(); 294 295 if(thisIncludeInsuranceCharge == null) { 296 objectsEqual = objectsEqual && (thatIncludeInsuranceCharge == null); 297 } else { 298 objectsEqual = objectsEqual && thisIncludeInsuranceCharge.equals(thatIncludeInsuranceCharge); 299 } 300 } 301 302 if(objectsEqual) { 303 Integer thisPercent = getPercent(); 304 Integer thatPercent = that.getPercent(); 305 306 if(thisPercent == null) { 307 objectsEqual = objectsEqual && (thatPercent == null); 308 } else { 309 objectsEqual = objectsEqual && thisPercent.equals(thatPercent); 310 } 311 } 312 313 if(objectsEqual) { 314 Boolean thisIsDefault = getIsDefault(); 315 Boolean thatIsDefault = that.getIsDefault(); 316 317 if(thisIsDefault == null) { 318 objectsEqual = objectsEqual && (thatIsDefault == null); 319 } else { 320 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 321 } 322 } 323 324 if(objectsEqual) { 325 Integer thisSortOrder = getSortOrder(); 326 Integer thatSortOrder = that.getSortOrder(); 327 328 if(thisSortOrder == null) { 329 objectsEqual = objectsEqual && (thatSortOrder == null); 330 } else { 331 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 332 } 333 } 334 335 if(objectsEqual) { 336 Long thisFromTime = getFromTime(); 337 Long thatFromTime = that.getFromTime(); 338 339 if(thisFromTime == null) { 340 objectsEqual = objectsEqual && (thatFromTime == null); 341 } else { 342 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 343 } 344 } 345 346 if(objectsEqual) { 347 Long thisThruTime = getThruTime(); 348 Long thatThruTime = that.getThruTime(); 349 350 if(thisThruTime == null) { 351 objectsEqual = objectsEqual && (thatThruTime == null); 352 } else { 353 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 354 } 355 } 356 357 return objectsEqual; 358 } else { 359 return false; 360 } 361 } 362 363 @Override 364 public boolean hasBeenModified() { 365 return taxPKHasBeenModified || taxNameHasBeenModified || contactMechanismPurposePKHasBeenModified || glAccountPKHasBeenModified || includeShippingChargeHasBeenModified || includeProcessingChargeHasBeenModified || includeInsuranceChargeHasBeenModified || percentHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 366 } 367 368 @Override 369 public void clearHasBeenModified() { 370 taxPKHasBeenModified = false; 371 taxNameHasBeenModified = false; 372 contactMechanismPurposePKHasBeenModified = false; 373 glAccountPKHasBeenModified = false; 374 includeShippingChargeHasBeenModified = false; 375 includeProcessingChargeHasBeenModified = false; 376 includeInsuranceChargeHasBeenModified = false; 377 percentHasBeenModified = false; 378 isDefaultHasBeenModified = false; 379 sortOrderHasBeenModified = false; 380 fromTimeHasBeenModified = false; 381 thruTimeHasBeenModified = false; 382 } 383 384 public TaxPK getTaxPK() { 385 return taxPK; 386 } 387 388 public void setTaxPK(TaxPK taxPK) 389 throws PersistenceNotNullException { 390 checkForNull(taxPK); 391 392 boolean update = true; 393 394 if(this.taxPK != null) { 395 if(this.taxPK.equals(taxPK)) { 396 update = false; 397 } 398 } else if(taxPK == null) { 399 update = false; 400 } 401 402 if(update) { 403 this.taxPK = taxPK; 404 taxPKHasBeenModified = true; 405 clearHashAndString(); 406 } 407 } 408 409 public boolean getTaxPKHasBeenModified() { 410 return taxPKHasBeenModified; 411 } 412 413 public String getTaxName() { 414 return taxName; 415 } 416 417 public void setTaxName(String taxName) 418 throws PersistenceNotNullException { 419 checkForNull(taxName); 420 421 boolean update = true; 422 423 if(this.taxName != null) { 424 if(this.taxName.equals(taxName)) { 425 update = false; 426 } 427 } else if(taxName == null) { 428 update = false; 429 } 430 431 if(update) { 432 this.taxName = taxName; 433 taxNameHasBeenModified = true; 434 clearHashAndString(); 435 } 436 } 437 438 public boolean getTaxNameHasBeenModified() { 439 return taxNameHasBeenModified; 440 } 441 442 public ContactMechanismPurposePK getContactMechanismPurposePK() { 443 return contactMechanismPurposePK; 444 } 445 446 public void setContactMechanismPurposePK(ContactMechanismPurposePK contactMechanismPurposePK) 447 throws PersistenceNotNullException { 448 checkForNull(contactMechanismPurposePK); 449 450 boolean update = true; 451 452 if(this.contactMechanismPurposePK != null) { 453 if(this.contactMechanismPurposePK.equals(contactMechanismPurposePK)) { 454 update = false; 455 } 456 } else if(contactMechanismPurposePK == null) { 457 update = false; 458 } 459 460 if(update) { 461 this.contactMechanismPurposePK = contactMechanismPurposePK; 462 contactMechanismPurposePKHasBeenModified = true; 463 clearHashAndString(); 464 } 465 } 466 467 public boolean getContactMechanismPurposePKHasBeenModified() { 468 return contactMechanismPurposePKHasBeenModified; 469 } 470 471 public GlAccountPK getGlAccountPK() { 472 return glAccountPK; 473 } 474 475 public void setGlAccountPK(GlAccountPK glAccountPK) 476 throws PersistenceNotNullException { 477 checkForNull(glAccountPK); 478 479 boolean update = true; 480 481 if(this.glAccountPK != null) { 482 if(this.glAccountPK.equals(glAccountPK)) { 483 update = false; 484 } 485 } else if(glAccountPK == null) { 486 update = false; 487 } 488 489 if(update) { 490 this.glAccountPK = glAccountPK; 491 glAccountPKHasBeenModified = true; 492 clearHashAndString(); 493 } 494 } 495 496 public boolean getGlAccountPKHasBeenModified() { 497 return glAccountPKHasBeenModified; 498 } 499 500 public Boolean getIncludeShippingCharge() { 501 return includeShippingCharge; 502 } 503 504 public void setIncludeShippingCharge(Boolean includeShippingCharge) 505 throws PersistenceNotNullException { 506 checkForNull(includeShippingCharge); 507 508 boolean update = true; 509 510 if(this.includeShippingCharge != null) { 511 if(this.includeShippingCharge.equals(includeShippingCharge)) { 512 update = false; 513 } 514 } else if(includeShippingCharge == null) { 515 update = false; 516 } 517 518 if(update) { 519 this.includeShippingCharge = includeShippingCharge; 520 includeShippingChargeHasBeenModified = true; 521 clearHashAndString(); 522 } 523 } 524 525 public boolean getIncludeShippingChargeHasBeenModified() { 526 return includeShippingChargeHasBeenModified; 527 } 528 529 public Boolean getIncludeProcessingCharge() { 530 return includeProcessingCharge; 531 } 532 533 public void setIncludeProcessingCharge(Boolean includeProcessingCharge) 534 throws PersistenceNotNullException { 535 checkForNull(includeProcessingCharge); 536 537 boolean update = true; 538 539 if(this.includeProcessingCharge != null) { 540 if(this.includeProcessingCharge.equals(includeProcessingCharge)) { 541 update = false; 542 } 543 } else if(includeProcessingCharge == null) { 544 update = false; 545 } 546 547 if(update) { 548 this.includeProcessingCharge = includeProcessingCharge; 549 includeProcessingChargeHasBeenModified = true; 550 clearHashAndString(); 551 } 552 } 553 554 public boolean getIncludeProcessingChargeHasBeenModified() { 555 return includeProcessingChargeHasBeenModified; 556 } 557 558 public Boolean getIncludeInsuranceCharge() { 559 return includeInsuranceCharge; 560 } 561 562 public void setIncludeInsuranceCharge(Boolean includeInsuranceCharge) 563 throws PersistenceNotNullException { 564 checkForNull(includeInsuranceCharge); 565 566 boolean update = true; 567 568 if(this.includeInsuranceCharge != null) { 569 if(this.includeInsuranceCharge.equals(includeInsuranceCharge)) { 570 update = false; 571 } 572 } else if(includeInsuranceCharge == null) { 573 update = false; 574 } 575 576 if(update) { 577 this.includeInsuranceCharge = includeInsuranceCharge; 578 includeInsuranceChargeHasBeenModified = true; 579 clearHashAndString(); 580 } 581 } 582 583 public boolean getIncludeInsuranceChargeHasBeenModified() { 584 return includeInsuranceChargeHasBeenModified; 585 } 586 587 public Integer getPercent() { 588 return percent; 589 } 590 591 public void setPercent(Integer percent) 592 throws PersistenceNotNullException { 593 checkForNull(percent); 594 595 boolean update = true; 596 597 if(this.percent != null) { 598 if(this.percent.equals(percent)) { 599 update = false; 600 } 601 } else if(percent == null) { 602 update = false; 603 } 604 605 if(update) { 606 this.percent = percent; 607 percentHasBeenModified = true; 608 clearHashAndString(); 609 } 610 } 611 612 public boolean getPercentHasBeenModified() { 613 return percentHasBeenModified; 614 } 615 616 public Boolean getIsDefault() { 617 return isDefault; 618 } 619 620 public void setIsDefault(Boolean isDefault) 621 throws PersistenceNotNullException { 622 checkForNull(isDefault); 623 624 boolean update = true; 625 626 if(this.isDefault != null) { 627 if(this.isDefault.equals(isDefault)) { 628 update = false; 629 } 630 } else if(isDefault == null) { 631 update = false; 632 } 633 634 if(update) { 635 this.isDefault = isDefault; 636 isDefaultHasBeenModified = true; 637 clearHashAndString(); 638 } 639 } 640 641 public boolean getIsDefaultHasBeenModified() { 642 return isDefaultHasBeenModified; 643 } 644 645 public Integer getSortOrder() { 646 return sortOrder; 647 } 648 649 public void setSortOrder(Integer sortOrder) 650 throws PersistenceNotNullException { 651 checkForNull(sortOrder); 652 653 boolean update = true; 654 655 if(this.sortOrder != null) { 656 if(this.sortOrder.equals(sortOrder)) { 657 update = false; 658 } 659 } else if(sortOrder == null) { 660 update = false; 661 } 662 663 if(update) { 664 this.sortOrder = sortOrder; 665 sortOrderHasBeenModified = true; 666 clearHashAndString(); 667 } 668 } 669 670 public boolean getSortOrderHasBeenModified() { 671 return sortOrderHasBeenModified; 672 } 673 674 public Long getFromTime() { 675 return fromTime; 676 } 677 678 public void setFromTime(Long fromTime) 679 throws PersistenceNotNullException { 680 checkForNull(fromTime); 681 682 boolean update = true; 683 684 if(this.fromTime != null) { 685 if(this.fromTime.equals(fromTime)) { 686 update = false; 687 } 688 } else if(fromTime == null) { 689 update = false; 690 } 691 692 if(update) { 693 this.fromTime = fromTime; 694 fromTimeHasBeenModified = true; 695 clearHashAndString(); 696 } 697 } 698 699 public boolean getFromTimeHasBeenModified() { 700 return fromTimeHasBeenModified; 701 } 702 703 public Long getThruTime() { 704 return thruTime; 705 } 706 707 public void setThruTime(Long thruTime) 708 throws PersistenceNotNullException { 709 checkForNull(thruTime); 710 711 boolean update = true; 712 713 if(this.thruTime != null) { 714 if(this.thruTime.equals(thruTime)) { 715 update = false; 716 } 717 } else if(thruTime == null) { 718 update = false; 719 } 720 721 if(update) { 722 this.thruTime = thruTime; 723 thruTimeHasBeenModified = true; 724 clearHashAndString(); 725 } 726 } 727 728 public boolean getThruTimeHasBeenModified() { 729 return thruTimeHasBeenModified; 730 } 731 732}