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 * InventoryTransactionDetailValue.java 021 */ 022 023package com.echothree.model.data.inventory.server.value; 024 025import com.echothree.model.data.inventory.common.pk.InventoryTransactionDetailPK; 026 027import com.echothree.model.data.inventory.server.factory.InventoryTransactionDetailFactory; 028 029import com.echothree.model.data.inventory.common.pk.InventoryTransactionPK; 030import com.echothree.model.data.inventory.common.pk.InventoryTransactionTypePK; 031import com.echothree.model.data.party.common.pk.PartyPK; 032import com.echothree.model.data.inventory.common.pk.InventoryTransactionReasonPK; 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 InventoryTransactionDetailValue 045 extends BaseValue<InventoryTransactionDetailPK> 046 implements Cloneable, Serializable { 047 048 private InventoryTransactionPK inventoryTransactionPK; 049 private boolean inventoryTransactionPKHasBeenModified = false; 050 private InventoryTransactionTypePK inventoryTransactionTypePK; 051 private boolean inventoryTransactionTypePKHasBeenModified = false; 052 private String inventoryTransactionName; 053 private boolean inventoryTransactionNameHasBeenModified = false; 054 private PartyPK companyPartyPK; 055 private boolean companyPartyPKHasBeenModified = false; 056 private InventoryTransactionReasonPK inventoryTransactionReasonPK; 057 private boolean inventoryTransactionReasonPKHasBeenModified = false; 058 private String reference; 059 private boolean referenceHasBeenModified = false; 060 private String description; 061 private boolean descriptionHasBeenModified = 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(InventoryTransactionPK inventoryTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransactionName, PartyPK companyPartyPK, InventoryTransactionReasonPK inventoryTransactionReasonPK, String reference, String description, Long fromTime, Long thruTime) 071 throws PersistenceNotNullException { 072 checkForNull(inventoryTransactionPK); 073 this.inventoryTransactionPK = inventoryTransactionPK; 074 checkForNull(inventoryTransactionTypePK); 075 this.inventoryTransactionTypePK = inventoryTransactionTypePK; 076 checkForNull(inventoryTransactionName); 077 this.inventoryTransactionName = inventoryTransactionName; 078 checkForNull(companyPartyPK); 079 this.companyPartyPK = companyPartyPK; 080 this.inventoryTransactionReasonPK = inventoryTransactionReasonPK; 081 this.reference = reference; 082 this.description = description; 083 checkForNull(fromTime); 084 this.fromTime = fromTime; 085 checkForNull(thruTime); 086 this.thruTime = thruTime; 087 } 088 089 /** Creates a new instance of InventoryTransactionDetailValue */ 090 public InventoryTransactionDetailValue(InventoryTransactionDetailPK inventoryTransactionDetailPK, InventoryTransactionPK inventoryTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransactionName, PartyPK companyPartyPK, InventoryTransactionReasonPK inventoryTransactionReasonPK, String reference, String description, Long fromTime, Long thruTime) 091 throws PersistenceNotNullException { 092 super(inventoryTransactionDetailPK); 093 constructFields(inventoryTransactionPK, inventoryTransactionTypePK, inventoryTransactionName, companyPartyPK, inventoryTransactionReasonPK, reference, description, fromTime, thruTime); 094 } 095 096 /** Creates a new instance of InventoryTransactionDetailValue */ 097 public InventoryTransactionDetailValue(InventoryTransactionPK inventoryTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransactionName, PartyPK companyPartyPK, InventoryTransactionReasonPK inventoryTransactionReasonPK, String reference, String description, Long fromTime, Long thruTime) 098 throws PersistenceNotNullException { 099 super(); 100 constructFields(inventoryTransactionPK, inventoryTransactionTypePK, inventoryTransactionName, companyPartyPK, inventoryTransactionReasonPK, reference, description, fromTime, thruTime); 101 } 102 103 @Override 104 @Nonnull 105 public InventoryTransactionDetailFactory getBaseFactoryInstance() { 106 return InventoryTransactionDetailFactory.getInstance(); 107 } 108 109 @Override 110 @Nonnull 111 public InventoryTransactionDetailValue 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 (InventoryTransactionDetailValue)result; 122 } 123 124 @Override 125 @Nonnull 126 public InventoryTransactionDetailPK getPrimaryKey() { 127 if(_primaryKey == null) { 128 _primaryKey = new InventoryTransactionDetailPK(entityId); 129 } 130 131 return _primaryKey; 132 } 133 134 private void clearHashAndString() { 135 _hashCode = null; 136 _stringValue = null; 137 } 138 139 @Override 140 public int hashCode() { 141 if(_hashCode == null) { 142 int hashCode = 17; 143 144 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 145 146 hashCode = 37 * hashCode + ((inventoryTransactionPK != null) ? inventoryTransactionPK.hashCode() : 0); 147 hashCode = 37 * hashCode + ((inventoryTransactionTypePK != null) ? inventoryTransactionTypePK.hashCode() : 0); 148 hashCode = 37 * hashCode + ((inventoryTransactionName != null) ? inventoryTransactionName.hashCode() : 0); 149 hashCode = 37 * hashCode + ((companyPartyPK != null) ? companyPartyPK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((inventoryTransactionReasonPK != null) ? inventoryTransactionReasonPK.hashCode() : 0); 151 hashCode = 37 * hashCode + ((reference != null) ? reference.hashCode() : 0); 152 hashCode = 37 * hashCode + ((description != null) ? description.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 @Nonnull 164 public String toString() { 165 if(_stringValue == null) { 166 _stringValue = "{" + 167 "entityId=" + getEntityId() + 168 ", inventoryTransactionPK=" + getInventoryTransactionPK() + 169 ", inventoryTransactionTypePK=" + getInventoryTransactionTypePK() + 170 ", inventoryTransactionName=" + getInventoryTransactionName() + 171 ", companyPartyPK=" + getCompanyPartyPK() + 172 ", inventoryTransactionReasonPK=" + getInventoryTransactionReasonPK() + 173 ", reference=" + getReference() + 174 ", description=" + getDescription() + 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 InventoryTransactionDetailValue 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 InventoryTransactionDetailValue that) { 209 boolean objectsEqual = true; 210 211 212 if(objectsEqual) { 213 InventoryTransactionPK thisInventoryTransactionPK = getInventoryTransactionPK(); 214 InventoryTransactionPK thatInventoryTransactionPK = that.getInventoryTransactionPK(); 215 216 if(thisInventoryTransactionPK == null) { 217 objectsEqual = objectsEqual && (thatInventoryTransactionPK == null); 218 } else { 219 objectsEqual = objectsEqual && thisInventoryTransactionPK.equals(thatInventoryTransactionPK); 220 } 221 } 222 223 if(objectsEqual) { 224 InventoryTransactionTypePK thisInventoryTransactionTypePK = getInventoryTransactionTypePK(); 225 InventoryTransactionTypePK thatInventoryTransactionTypePK = that.getInventoryTransactionTypePK(); 226 227 if(thisInventoryTransactionTypePK == null) { 228 objectsEqual = objectsEqual && (thatInventoryTransactionTypePK == null); 229 } else { 230 objectsEqual = objectsEqual && thisInventoryTransactionTypePK.equals(thatInventoryTransactionTypePK); 231 } 232 } 233 234 if(objectsEqual) { 235 String thisInventoryTransactionName = getInventoryTransactionName(); 236 String thatInventoryTransactionName = that.getInventoryTransactionName(); 237 238 if(thisInventoryTransactionName == null) { 239 objectsEqual = objectsEqual && (thatInventoryTransactionName == null); 240 } else { 241 objectsEqual = objectsEqual && thisInventoryTransactionName.equals(thatInventoryTransactionName); 242 } 243 } 244 245 if(objectsEqual) { 246 PartyPK thisCompanyPartyPK = getCompanyPartyPK(); 247 PartyPK thatCompanyPartyPK = that.getCompanyPartyPK(); 248 249 if(thisCompanyPartyPK == null) { 250 objectsEqual = objectsEqual && (thatCompanyPartyPK == null); 251 } else { 252 objectsEqual = objectsEqual && thisCompanyPartyPK.equals(thatCompanyPartyPK); 253 } 254 } 255 256 if(objectsEqual) { 257 InventoryTransactionReasonPK thisInventoryTransactionReasonPK = getInventoryTransactionReasonPK(); 258 InventoryTransactionReasonPK thatInventoryTransactionReasonPK = that.getInventoryTransactionReasonPK(); 259 260 if(thisInventoryTransactionReasonPK == null) { 261 objectsEqual = objectsEqual && (thatInventoryTransactionReasonPK == null); 262 } else { 263 objectsEqual = objectsEqual && thisInventoryTransactionReasonPK.equals(thatInventoryTransactionReasonPK); 264 } 265 } 266 267 if(objectsEqual) { 268 String thisReference = getReference(); 269 String thatReference = that.getReference(); 270 271 if(thisReference == null) { 272 objectsEqual = objectsEqual && (thatReference == null); 273 } else { 274 objectsEqual = objectsEqual && thisReference.equals(thatReference); 275 } 276 } 277 278 if(objectsEqual) { 279 String thisDescription = getDescription(); 280 String thatDescription = that.getDescription(); 281 282 if(thisDescription == null) { 283 objectsEqual = objectsEqual && (thatDescription == null); 284 } else { 285 objectsEqual = objectsEqual && thisDescription.equals(thatDescription); 286 } 287 } 288 289 if(objectsEqual) { 290 Long thisFromTime = getFromTime(); 291 Long thatFromTime = that.getFromTime(); 292 293 if(thisFromTime == null) { 294 objectsEqual = objectsEqual && (thatFromTime == null); 295 } else { 296 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 297 } 298 } 299 300 if(objectsEqual) { 301 Long thisThruTime = getThruTime(); 302 Long thatThruTime = that.getThruTime(); 303 304 if(thisThruTime == null) { 305 objectsEqual = objectsEqual && (thatThruTime == null); 306 } else { 307 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 308 } 309 } 310 311 return objectsEqual; 312 } else { 313 return false; 314 } 315 } 316 317 @Override 318 public boolean hasBeenModified() { 319 return inventoryTransactionPKHasBeenModified || inventoryTransactionTypePKHasBeenModified || inventoryTransactionNameHasBeenModified || companyPartyPKHasBeenModified || inventoryTransactionReasonPKHasBeenModified || referenceHasBeenModified || descriptionHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 320 } 321 322 @Override 323 public void clearHasBeenModified() { 324 inventoryTransactionPKHasBeenModified = false; 325 inventoryTransactionTypePKHasBeenModified = false; 326 inventoryTransactionNameHasBeenModified = false; 327 companyPartyPKHasBeenModified = false; 328 inventoryTransactionReasonPKHasBeenModified = false; 329 referenceHasBeenModified = false; 330 descriptionHasBeenModified = false; 331 fromTimeHasBeenModified = false; 332 thruTimeHasBeenModified = false; 333 } 334 335 @Nonnull 336 public InventoryTransactionPK getInventoryTransactionPK() { 337 return inventoryTransactionPK; 338 } 339 340 public void setInventoryTransactionPK(@Nonnull InventoryTransactionPK inventoryTransactionPK) 341 throws PersistenceNotNullException { 342 checkForNull(inventoryTransactionPK); 343 344 boolean update = true; 345 346 if(this.inventoryTransactionPK != null) { 347 if(this.inventoryTransactionPK.equals(inventoryTransactionPK)) { 348 update = false; 349 } 350 } else if(inventoryTransactionPK == null) { 351 update = false; 352 } 353 354 if(update) { 355 this.inventoryTransactionPK = inventoryTransactionPK; 356 inventoryTransactionPKHasBeenModified = true; 357 clearHashAndString(); 358 } 359 } 360 361 public boolean getInventoryTransactionPKHasBeenModified() { 362 return inventoryTransactionPKHasBeenModified; 363 } 364 365 @Nonnull 366 public InventoryTransactionTypePK getInventoryTransactionTypePK() { 367 return inventoryTransactionTypePK; 368 } 369 370 public void setInventoryTransactionTypePK(@Nonnull InventoryTransactionTypePK inventoryTransactionTypePK) 371 throws PersistenceNotNullException { 372 checkForNull(inventoryTransactionTypePK); 373 374 boolean update = true; 375 376 if(this.inventoryTransactionTypePK != null) { 377 if(this.inventoryTransactionTypePK.equals(inventoryTransactionTypePK)) { 378 update = false; 379 } 380 } else if(inventoryTransactionTypePK == null) { 381 update = false; 382 } 383 384 if(update) { 385 this.inventoryTransactionTypePK = inventoryTransactionTypePK; 386 inventoryTransactionTypePKHasBeenModified = true; 387 clearHashAndString(); 388 } 389 } 390 391 public boolean getInventoryTransactionTypePKHasBeenModified() { 392 return inventoryTransactionTypePKHasBeenModified; 393 } 394 395 @Nonnull 396 public String getInventoryTransactionName() { 397 return inventoryTransactionName; 398 } 399 400 public void setInventoryTransactionName(@Nonnull String inventoryTransactionName) 401 throws PersistenceNotNullException { 402 checkForNull(inventoryTransactionName); 403 404 boolean update = true; 405 406 if(this.inventoryTransactionName != null) { 407 if(this.inventoryTransactionName.equals(inventoryTransactionName)) { 408 update = false; 409 } 410 } else if(inventoryTransactionName == null) { 411 update = false; 412 } 413 414 if(update) { 415 this.inventoryTransactionName = inventoryTransactionName; 416 inventoryTransactionNameHasBeenModified = true; 417 clearHashAndString(); 418 } 419 } 420 421 public boolean getInventoryTransactionNameHasBeenModified() { 422 return inventoryTransactionNameHasBeenModified; 423 } 424 425 @Nonnull 426 public PartyPK getCompanyPartyPK() { 427 return companyPartyPK; 428 } 429 430 public void setCompanyPartyPK(@Nonnull PartyPK companyPartyPK) 431 throws PersistenceNotNullException { 432 checkForNull(companyPartyPK); 433 434 boolean update = true; 435 436 if(this.companyPartyPK != null) { 437 if(this.companyPartyPK.equals(companyPartyPK)) { 438 update = false; 439 } 440 } else if(companyPartyPK == null) { 441 update = false; 442 } 443 444 if(update) { 445 this.companyPartyPK = companyPartyPK; 446 companyPartyPKHasBeenModified = true; 447 clearHashAndString(); 448 } 449 } 450 451 public boolean getCompanyPartyPKHasBeenModified() { 452 return companyPartyPKHasBeenModified; 453 } 454 455 @Nullable 456 public InventoryTransactionReasonPK getInventoryTransactionReasonPK() { 457 return inventoryTransactionReasonPK; 458 } 459 460 public void setInventoryTransactionReasonPK(@Nullable InventoryTransactionReasonPK inventoryTransactionReasonPK) { 461 boolean update = true; 462 463 if(this.inventoryTransactionReasonPK != null) { 464 if(this.inventoryTransactionReasonPK.equals(inventoryTransactionReasonPK)) { 465 update = false; 466 } 467 } else if(inventoryTransactionReasonPK == null) { 468 update = false; 469 } 470 471 if(update) { 472 this.inventoryTransactionReasonPK = inventoryTransactionReasonPK; 473 inventoryTransactionReasonPKHasBeenModified = true; 474 clearHashAndString(); 475 } 476 } 477 478 public boolean getInventoryTransactionReasonPKHasBeenModified() { 479 return inventoryTransactionReasonPKHasBeenModified; 480 } 481 482 @Nullable 483 public String getReference() { 484 return reference; 485 } 486 487 public void setReference(@Nullable String reference) { 488 boolean update = true; 489 490 if(this.reference != null) { 491 if(this.reference.equals(reference)) { 492 update = false; 493 } 494 } else if(reference == null) { 495 update = false; 496 } 497 498 if(update) { 499 this.reference = reference; 500 referenceHasBeenModified = true; 501 clearHashAndString(); 502 } 503 } 504 505 public boolean getReferenceHasBeenModified() { 506 return referenceHasBeenModified; 507 } 508 509 @Nullable 510 public String getDescription() { 511 return description; 512 } 513 514 public void setDescription(@Nullable String description) { 515 boolean update = true; 516 517 if(this.description != null) { 518 if(this.description.equals(description)) { 519 update = false; 520 } 521 } else if(description == null) { 522 update = false; 523 } 524 525 if(update) { 526 this.description = description; 527 descriptionHasBeenModified = true; 528 clearHashAndString(); 529 } 530 } 531 532 public boolean getDescriptionHasBeenModified() { 533 return descriptionHasBeenModified; 534 } 535 536 @Nonnull 537 public Long getFromTime() { 538 return fromTime; 539 } 540 541 public void setFromTime(@Nonnull Long fromTime) 542 throws PersistenceNotNullException { 543 checkForNull(fromTime); 544 545 boolean update = true; 546 547 if(this.fromTime != null) { 548 if(this.fromTime.equals(fromTime)) { 549 update = false; 550 } 551 } else if(fromTime == null) { 552 update = false; 553 } 554 555 if(update) { 556 this.fromTime = fromTime; 557 fromTimeHasBeenModified = true; 558 clearHashAndString(); 559 } 560 } 561 562 public boolean getFromTimeHasBeenModified() { 563 return fromTimeHasBeenModified; 564 } 565 566 @Nonnull 567 public Long getThruTime() { 568 return thruTime; 569 } 570 571 public void setThruTime(@Nonnull Long thruTime) 572 throws PersistenceNotNullException { 573 checkForNull(thruTime); 574 575 boolean update = true; 576 577 if(this.thruTime != null) { 578 if(this.thruTime.equals(thruTime)) { 579 update = false; 580 } 581 } else if(thruTime == null) { 582 update = false; 583 } 584 585 if(update) { 586 this.thruTime = thruTime; 587 thruTimeHasBeenModified = true; 588 clearHashAndString(); 589 } 590 } 591 592 public boolean getThruTimeHasBeenModified() { 593 return thruTimeHasBeenModified; 594 } 595 596}