001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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 041public class PaymentMethodDetailValue 042 extends BaseValue<PaymentMethodDetailPK> 043 implements Cloneable, Serializable { 044 045 private PaymentMethodPK paymentMethodPK; 046 private boolean paymentMethodPKHasBeenModified = false; 047 private String paymentMethodName; 048 private boolean paymentMethodNameHasBeenModified = false; 049 private PaymentMethodTypePK paymentMethodTypePK; 050 private boolean paymentMethodTypePKHasBeenModified = false; 051 private PaymentProcessorPK paymentProcessorPK; 052 private boolean paymentProcessorPKHasBeenModified = false; 053 private SelectorPK itemSelectorPK; 054 private boolean itemSelectorPKHasBeenModified = false; 055 private SelectorPK salesOrderItemSelectorPK; 056 private boolean salesOrderItemSelectorPKHasBeenModified = false; 057 private Boolean isDefault; 058 private boolean isDefaultHasBeenModified = false; 059 private Integer sortOrder; 060 private boolean sortOrderHasBeenModified = false; 061 private Long fromTime; 062 private boolean fromTimeHasBeenModified = false; 063 private Long thruTime; 064 private boolean thruTimeHasBeenModified = false; 065 066 private transient Integer _hashCode = null; 067 private transient String _stringValue = null; 068 069 private void constructFields(PaymentMethodPK paymentMethodPK, String paymentMethodName, PaymentMethodTypePK paymentMethodTypePK, PaymentProcessorPK paymentProcessorPK, SelectorPK itemSelectorPK, SelectorPK salesOrderItemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 070 throws PersistenceNotNullException { 071 checkForNull(paymentMethodPK); 072 this.paymentMethodPK = paymentMethodPK; 073 checkForNull(paymentMethodName); 074 this.paymentMethodName = paymentMethodName; 075 checkForNull(paymentMethodTypePK); 076 this.paymentMethodTypePK = paymentMethodTypePK; 077 this.paymentProcessorPK = paymentProcessorPK; 078 this.itemSelectorPK = itemSelectorPK; 079 this.salesOrderItemSelectorPK = salesOrderItemSelectorPK; 080 checkForNull(isDefault); 081 this.isDefault = isDefault; 082 checkForNull(sortOrder); 083 this.sortOrder = sortOrder; 084 checkForNull(fromTime); 085 this.fromTime = fromTime; 086 checkForNull(thruTime); 087 this.thruTime = thruTime; 088 } 089 090 /** Creates a new instance of PaymentMethodDetailValue */ 091 public PaymentMethodDetailValue(PaymentMethodDetailPK paymentMethodDetailPK, PaymentMethodPK paymentMethodPK, String paymentMethodName, PaymentMethodTypePK paymentMethodTypePK, PaymentProcessorPK paymentProcessorPK, SelectorPK itemSelectorPK, SelectorPK salesOrderItemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 092 throws PersistenceNotNullException { 093 super(paymentMethodDetailPK); 094 constructFields(paymentMethodPK, paymentMethodName, paymentMethodTypePK, paymentProcessorPK, itemSelectorPK, salesOrderItemSelectorPK, isDefault, sortOrder, fromTime, thruTime); 095 } 096 097 /** Creates a new instance of PaymentMethodDetailValue */ 098 public PaymentMethodDetailValue(PaymentMethodPK paymentMethodPK, String paymentMethodName, PaymentMethodTypePK paymentMethodTypePK, PaymentProcessorPK paymentProcessorPK, SelectorPK itemSelectorPK, SelectorPK salesOrderItemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 099 throws PersistenceNotNullException { 100 super(); 101 constructFields(paymentMethodPK, paymentMethodName, paymentMethodTypePK, paymentProcessorPK, itemSelectorPK, salesOrderItemSelectorPK, isDefault, sortOrder, fromTime, thruTime); 102 } 103 104 @Override 105 public PaymentMethodDetailFactory getBaseFactoryInstance() { 106 return PaymentMethodDetailFactory.getInstance(); 107 } 108 109 @Override 110 public PaymentMethodDetailValue clone() { 111 Object result; 112 113 try { 114 result = super.clone(); 115 } catch (CloneNotSupportedException cnse) { 116 // This shouldn't happen, fail when it does. 117 throw new PersistenceCloneException(cnse); 118 } 119 120 return (PaymentMethodDetailValue)result; 121 } 122 123 @Override 124 public PaymentMethodDetailPK getPrimaryKey() { 125 if(_primaryKey == null) { 126 _primaryKey = new PaymentMethodDetailPK(entityId); 127 } 128 129 return _primaryKey; 130 } 131 132 private void clearHashAndString() { 133 _hashCode = null; 134 _stringValue = null; 135 } 136 137 @Override 138 public int hashCode() { 139 if(_hashCode == null) { 140 int hashCode = 17; 141 142 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 143 144 hashCode = 37 * hashCode + ((paymentMethodPK != null) ? paymentMethodPK.hashCode() : 0); 145 hashCode = 37 * hashCode + ((paymentMethodName != null) ? paymentMethodName.hashCode() : 0); 146 hashCode = 37 * hashCode + ((paymentMethodTypePK != null) ? paymentMethodTypePK.hashCode() : 0); 147 hashCode = 37 * hashCode + ((paymentProcessorPK != null) ? paymentProcessorPK.hashCode() : 0); 148 hashCode = 37 * hashCode + ((itemSelectorPK != null) ? itemSelectorPK.hashCode() : 0); 149 hashCode = 37 * hashCode + ((salesOrderItemSelectorPK != null) ? salesOrderItemSelectorPK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 151 hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.hashCode() : 0); 152 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 153 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 154 155 _hashCode = hashCode; 156 } 157 158 return _hashCode; 159 } 160 161 @Override 162 public String toString() { 163 if(_stringValue == null) { 164 StringBuilder stringValue = new StringBuilder("{"); 165 166 stringValue.append("entityId=").append(getEntityId()); 167 168 stringValue.append(", paymentMethodPK=").append(getPaymentMethodPK()); 169 stringValue.append(", paymentMethodName=").append(getPaymentMethodName()); 170 stringValue.append(", paymentMethodTypePK=").append(getPaymentMethodTypePK()); 171 stringValue.append(", paymentProcessorPK=").append(getPaymentProcessorPK()); 172 stringValue.append(", itemSelectorPK=").append(getItemSelectorPK()); 173 stringValue.append(", salesOrderItemSelectorPK=").append(getSalesOrderItemSelectorPK()); 174 stringValue.append(", isDefault=").append(getIsDefault()); 175 stringValue.append(", sortOrder=").append(getSortOrder()); 176 stringValue.append(", fromTime=").append(getFromTime()); 177 stringValue.append(", thruTime=").append(getThruTime()); 178 179 stringValue.append('}'); 180 181 _stringValue = stringValue.toString(); 182 } 183 return _stringValue; 184 } 185 186 @Override 187 public boolean equals(Object other) { 188 if(this == other) 189 return true; 190 191 if(!hasIdentity()) 192 return false; 193 194 if(other instanceof PaymentMethodDetailValue) { 195 PaymentMethodDetailValue that = (PaymentMethodDetailValue)other; 196 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 = 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) { 215 PaymentMethodDetailValue that = (PaymentMethodDetailValue)other; 216 boolean objectsEqual = true; 217 218 219 if(objectsEqual) { 220 PaymentMethodPK thisPaymentMethodPK = getPaymentMethodPK(); 221 PaymentMethodPK thatPaymentMethodPK = that.getPaymentMethodPK(); 222 223 if(thisPaymentMethodPK == null) { 224 objectsEqual = objectsEqual && (thatPaymentMethodPK == null); 225 } else { 226 objectsEqual = objectsEqual && thisPaymentMethodPK.equals(thatPaymentMethodPK); 227 } 228 } 229 230 if(objectsEqual) { 231 String thisPaymentMethodName = getPaymentMethodName(); 232 String thatPaymentMethodName = that.getPaymentMethodName(); 233 234 if(thisPaymentMethodName == null) { 235 objectsEqual = objectsEqual && (thatPaymentMethodName == null); 236 } else { 237 objectsEqual = objectsEqual && thisPaymentMethodName.equals(thatPaymentMethodName); 238 } 239 } 240 241 if(objectsEqual) { 242 PaymentMethodTypePK thisPaymentMethodTypePK = getPaymentMethodTypePK(); 243 PaymentMethodTypePK thatPaymentMethodTypePK = that.getPaymentMethodTypePK(); 244 245 if(thisPaymentMethodTypePK == null) { 246 objectsEqual = objectsEqual && (thatPaymentMethodTypePK == null); 247 } else { 248 objectsEqual = objectsEqual && thisPaymentMethodTypePK.equals(thatPaymentMethodTypePK); 249 } 250 } 251 252 if(objectsEqual) { 253 PaymentProcessorPK thisPaymentProcessorPK = getPaymentProcessorPK(); 254 PaymentProcessorPK thatPaymentProcessorPK = that.getPaymentProcessorPK(); 255 256 if(thisPaymentProcessorPK == null) { 257 objectsEqual = objectsEqual && (thatPaymentProcessorPK == null); 258 } else { 259 objectsEqual = objectsEqual && thisPaymentProcessorPK.equals(thatPaymentProcessorPK); 260 } 261 } 262 263 if(objectsEqual) { 264 SelectorPK thisItemSelectorPK = getItemSelectorPK(); 265 SelectorPK thatItemSelectorPK = that.getItemSelectorPK(); 266 267 if(thisItemSelectorPK == null) { 268 objectsEqual = objectsEqual && (thatItemSelectorPK == null); 269 } else { 270 objectsEqual = objectsEqual && thisItemSelectorPK.equals(thatItemSelectorPK); 271 } 272 } 273 274 if(objectsEqual) { 275 SelectorPK thisSalesOrderItemSelectorPK = getSalesOrderItemSelectorPK(); 276 SelectorPK thatSalesOrderItemSelectorPK = that.getSalesOrderItemSelectorPK(); 277 278 if(thisSalesOrderItemSelectorPK == null) { 279 objectsEqual = objectsEqual && (thatSalesOrderItemSelectorPK == null); 280 } else { 281 objectsEqual = objectsEqual && thisSalesOrderItemSelectorPK.equals(thatSalesOrderItemSelectorPK); 282 } 283 } 284 285 if(objectsEqual) { 286 Boolean thisIsDefault = getIsDefault(); 287 Boolean thatIsDefault = that.getIsDefault(); 288 289 if(thisIsDefault == null) { 290 objectsEqual = objectsEqual && (thatIsDefault == null); 291 } else { 292 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 293 } 294 } 295 296 if(objectsEqual) { 297 Integer thisSortOrder = getSortOrder(); 298 Integer thatSortOrder = that.getSortOrder(); 299 300 if(thisSortOrder == null) { 301 objectsEqual = objectsEqual && (thatSortOrder == null); 302 } else { 303 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 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 paymentMethodPKHasBeenModified || paymentMethodNameHasBeenModified || paymentMethodTypePKHasBeenModified || paymentProcessorPKHasBeenModified || itemSelectorPKHasBeenModified || salesOrderItemSelectorPKHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 338 } 339 340 @Override 341 public void clearHasBeenModified() { 342 paymentMethodPKHasBeenModified = false; 343 paymentMethodNameHasBeenModified = false; 344 paymentMethodTypePKHasBeenModified = false; 345 paymentProcessorPKHasBeenModified = false; 346 itemSelectorPKHasBeenModified = false; 347 salesOrderItemSelectorPKHasBeenModified = false; 348 isDefaultHasBeenModified = false; 349 sortOrderHasBeenModified = false; 350 fromTimeHasBeenModified = false; 351 thruTimeHasBeenModified = false; 352 } 353 354 public PaymentMethodPK getPaymentMethodPK() { 355 return paymentMethodPK; 356 } 357 358 public void setPaymentMethodPK(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 public String getPaymentMethodName() { 384 return paymentMethodName; 385 } 386 387 public void setPaymentMethodName(String paymentMethodName) 388 throws PersistenceNotNullException { 389 checkForNull(paymentMethodName); 390 391 boolean update = true; 392 393 if(this.paymentMethodName != null) { 394 if(this.paymentMethodName.equals(paymentMethodName)) { 395 update = false; 396 } 397 } else if(paymentMethodName == null) { 398 update = false; 399 } 400 401 if(update) { 402 this.paymentMethodName = paymentMethodName; 403 paymentMethodNameHasBeenModified = true; 404 clearHashAndString(); 405 } 406 } 407 408 public boolean getPaymentMethodNameHasBeenModified() { 409 return paymentMethodNameHasBeenModified; 410 } 411 412 public PaymentMethodTypePK getPaymentMethodTypePK() { 413 return paymentMethodTypePK; 414 } 415 416 public void setPaymentMethodTypePK(PaymentMethodTypePK paymentMethodTypePK) 417 throws PersistenceNotNullException { 418 checkForNull(paymentMethodTypePK); 419 420 boolean update = true; 421 422 if(this.paymentMethodTypePK != null) { 423 if(this.paymentMethodTypePK.equals(paymentMethodTypePK)) { 424 update = false; 425 } 426 } else if(paymentMethodTypePK == null) { 427 update = false; 428 } 429 430 if(update) { 431 this.paymentMethodTypePK = paymentMethodTypePK; 432 paymentMethodTypePKHasBeenModified = true; 433 clearHashAndString(); 434 } 435 } 436 437 public boolean getPaymentMethodTypePKHasBeenModified() { 438 return paymentMethodTypePKHasBeenModified; 439 } 440 441 public PaymentProcessorPK getPaymentProcessorPK() { 442 return paymentProcessorPK; 443 } 444 445 public void setPaymentProcessorPK(PaymentProcessorPK paymentProcessorPK) { 446 boolean update = true; 447 448 if(this.paymentProcessorPK != null) { 449 if(this.paymentProcessorPK.equals(paymentProcessorPK)) { 450 update = false; 451 } 452 } else if(paymentProcessorPK == null) { 453 update = false; 454 } 455 456 if(update) { 457 this.paymentProcessorPK = paymentProcessorPK; 458 paymentProcessorPKHasBeenModified = true; 459 clearHashAndString(); 460 } 461 } 462 463 public boolean getPaymentProcessorPKHasBeenModified() { 464 return paymentProcessorPKHasBeenModified; 465 } 466 467 public SelectorPK getItemSelectorPK() { 468 return itemSelectorPK; 469 } 470 471 public void setItemSelectorPK(SelectorPK itemSelectorPK) { 472 boolean update = true; 473 474 if(this.itemSelectorPK != null) { 475 if(this.itemSelectorPK.equals(itemSelectorPK)) { 476 update = false; 477 } 478 } else if(itemSelectorPK == null) { 479 update = false; 480 } 481 482 if(update) { 483 this.itemSelectorPK = itemSelectorPK; 484 itemSelectorPKHasBeenModified = true; 485 clearHashAndString(); 486 } 487 } 488 489 public boolean getItemSelectorPKHasBeenModified() { 490 return itemSelectorPKHasBeenModified; 491 } 492 493 public SelectorPK getSalesOrderItemSelectorPK() { 494 return salesOrderItemSelectorPK; 495 } 496 497 public void setSalesOrderItemSelectorPK(SelectorPK salesOrderItemSelectorPK) { 498 boolean update = true; 499 500 if(this.salesOrderItemSelectorPK != null) { 501 if(this.salesOrderItemSelectorPK.equals(salesOrderItemSelectorPK)) { 502 update = false; 503 } 504 } else if(salesOrderItemSelectorPK == null) { 505 update = false; 506 } 507 508 if(update) { 509 this.salesOrderItemSelectorPK = salesOrderItemSelectorPK; 510 salesOrderItemSelectorPKHasBeenModified = true; 511 clearHashAndString(); 512 } 513 } 514 515 public boolean getSalesOrderItemSelectorPKHasBeenModified() { 516 return salesOrderItemSelectorPKHasBeenModified; 517 } 518 519 public Boolean getIsDefault() { 520 return isDefault; 521 } 522 523 public void setIsDefault(Boolean isDefault) 524 throws PersistenceNotNullException { 525 checkForNull(isDefault); 526 527 boolean update = true; 528 529 if(this.isDefault != null) { 530 if(this.isDefault.equals(isDefault)) { 531 update = false; 532 } 533 } else if(isDefault == null) { 534 update = false; 535 } 536 537 if(update) { 538 this.isDefault = isDefault; 539 isDefaultHasBeenModified = true; 540 clearHashAndString(); 541 } 542 } 543 544 public boolean getIsDefaultHasBeenModified() { 545 return isDefaultHasBeenModified; 546 } 547 548 public Integer getSortOrder() { 549 return sortOrder; 550 } 551 552 public void setSortOrder(Integer sortOrder) 553 throws PersistenceNotNullException { 554 checkForNull(sortOrder); 555 556 boolean update = true; 557 558 if(this.sortOrder != null) { 559 if(this.sortOrder.equals(sortOrder)) { 560 update = false; 561 } 562 } else if(sortOrder == null) { 563 update = false; 564 } 565 566 if(update) { 567 this.sortOrder = sortOrder; 568 sortOrderHasBeenModified = true; 569 clearHashAndString(); 570 } 571 } 572 573 public boolean getSortOrderHasBeenModified() { 574 return sortOrderHasBeenModified; 575 } 576 577 public Long getFromTime() { 578 return fromTime; 579 } 580 581 public void setFromTime(Long fromTime) 582 throws PersistenceNotNullException { 583 checkForNull(fromTime); 584 585 boolean update = true; 586 587 if(this.fromTime != null) { 588 if(this.fromTime.equals(fromTime)) { 589 update = false; 590 } 591 } else if(fromTime == null) { 592 update = false; 593 } 594 595 if(update) { 596 this.fromTime = fromTime; 597 fromTimeHasBeenModified = true; 598 clearHashAndString(); 599 } 600 } 601 602 public boolean getFromTimeHasBeenModified() { 603 return fromTimeHasBeenModified; 604 } 605 606 public Long getThruTime() { 607 return thruTime; 608 } 609 610 public void setThruTime(Long thruTime) 611 throws PersistenceNotNullException { 612 checkForNull(thruTime); 613 614 boolean update = true; 615 616 if(this.thruTime != null) { 617 if(this.thruTime.equals(thruTime)) { 618 update = false; 619 } 620 } else if(thruTime == null) { 621 update = false; 622 } 623 624 if(update) { 625 this.thruTime = thruTime; 626 thruTimeHasBeenModified = true; 627 clearHashAndString(); 628 } 629 } 630 631 public boolean getThruTimeHasBeenModified() { 632 return thruTimeHasBeenModified; 633 } 634 635}