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