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 * InventoryTransferTransactionDetailValue.java 021 */ 022 023package com.echothree.model.data.inventory.server.value; 024 025import com.echothree.model.data.inventory.common.pk.InventoryTransferTransactionDetailPK; 026 027import com.echothree.model.data.inventory.server.factory.InventoryTransferTransactionDetailFactory; 028 029import com.echothree.model.data.inventory.common.pk.InventoryTransferTransactionPK; 030import com.echothree.model.data.inventory.common.pk.InventoryTransactionTypePK; 031import com.echothree.model.data.inventory.common.pk.InventoryTransactionPK; 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 040import javax.annotation.Nonnull; 041import javax.annotation.Nullable; 042 043public class InventoryTransferTransactionDetailValue 044 extends BaseValue<InventoryTransferTransactionDetailPK> 045 implements Cloneable, Serializable { 046 047 private InventoryTransferTransactionPK inventoryTransferTransactionPK; 048 private boolean inventoryTransferTransactionPKHasBeenModified = false; 049 private InventoryTransactionTypePK inventoryTransactionTypePK; 050 private boolean inventoryTransactionTypePKHasBeenModified = false; 051 private String inventoryTransferTransactionName; 052 private boolean inventoryTransferTransactionNameHasBeenModified = false; 053 private InventoryTransactionPK sourceInventoryTransactionPK; 054 private boolean sourceInventoryTransactionPKHasBeenModified = false; 055 private InventoryTransactionPK destinationInventoryTransactionPK; 056 private boolean destinationInventoryTransactionPKHasBeenModified = false; 057 private String reference; 058 private boolean referenceHasBeenModified = false; 059 private String description; 060 private boolean descriptionHasBeenModified = 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(InventoryTransferTransactionPK inventoryTransferTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransferTransactionName, InventoryTransactionPK sourceInventoryTransactionPK, InventoryTransactionPK destinationInventoryTransactionPK, String reference, String description, Long fromTime, Long thruTime) 070 throws PersistenceNotNullException { 071 checkForNull(inventoryTransferTransactionPK); 072 this.inventoryTransferTransactionPK = inventoryTransferTransactionPK; 073 checkForNull(inventoryTransactionTypePK); 074 this.inventoryTransactionTypePK = inventoryTransactionTypePK; 075 checkForNull(inventoryTransferTransactionName); 076 this.inventoryTransferTransactionName = inventoryTransferTransactionName; 077 checkForNull(sourceInventoryTransactionPK); 078 this.sourceInventoryTransactionPK = sourceInventoryTransactionPK; 079 checkForNull(destinationInventoryTransactionPK); 080 this.destinationInventoryTransactionPK = destinationInventoryTransactionPK; 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 InventoryTransferTransactionDetailValue */ 090 public InventoryTransferTransactionDetailValue(InventoryTransferTransactionDetailPK inventoryTransferTransactionDetailPK, InventoryTransferTransactionPK inventoryTransferTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransferTransactionName, InventoryTransactionPK sourceInventoryTransactionPK, InventoryTransactionPK destinationInventoryTransactionPK, String reference, String description, Long fromTime, Long thruTime) 091 throws PersistenceNotNullException { 092 super(inventoryTransferTransactionDetailPK); 093 constructFields(inventoryTransferTransactionPK, inventoryTransactionTypePK, inventoryTransferTransactionName, sourceInventoryTransactionPK, destinationInventoryTransactionPK, reference, description, fromTime, thruTime); 094 } 095 096 /** Creates a new instance of InventoryTransferTransactionDetailValue */ 097 public InventoryTransferTransactionDetailValue(InventoryTransferTransactionPK inventoryTransferTransactionPK, InventoryTransactionTypePK inventoryTransactionTypePK, String inventoryTransferTransactionName, InventoryTransactionPK sourceInventoryTransactionPK, InventoryTransactionPK destinationInventoryTransactionPK, String reference, String description, Long fromTime, Long thruTime) 098 throws PersistenceNotNullException { 099 super(); 100 constructFields(inventoryTransferTransactionPK, inventoryTransactionTypePK, inventoryTransferTransactionName, sourceInventoryTransactionPK, destinationInventoryTransactionPK, reference, description, fromTime, thruTime); 101 } 102 103 @Override 104 @Nonnull 105 public InventoryTransferTransactionDetailFactory getBaseFactoryInstance() { 106 return InventoryTransferTransactionDetailFactory.getInstance(); 107 } 108 109 @Override 110 @Nonnull 111 public InventoryTransferTransactionDetailValue 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 (InventoryTransferTransactionDetailValue)result; 122 } 123 124 @Override 125 @Nonnull 126 public InventoryTransferTransactionDetailPK getPrimaryKey() { 127 if(_primaryKey == null) { 128 _primaryKey = new InventoryTransferTransactionDetailPK(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 + ((inventoryTransferTransactionPK != null) ? inventoryTransferTransactionPK.hashCode() : 0); 147 hashCode = 37 * hashCode + ((inventoryTransactionTypePK != null) ? inventoryTransactionTypePK.hashCode() : 0); 148 hashCode = 37 * hashCode + ((inventoryTransferTransactionName != null) ? inventoryTransferTransactionName.hashCode() : 0); 149 hashCode = 37 * hashCode + ((sourceInventoryTransactionPK != null) ? sourceInventoryTransactionPK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((destinationInventoryTransactionPK != null) ? destinationInventoryTransactionPK.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 ", inventoryTransferTransactionPK=" + getInventoryTransferTransactionPK() + 169 ", inventoryTransactionTypePK=" + getInventoryTransactionTypePK() + 170 ", inventoryTransferTransactionName=" + getInventoryTransferTransactionName() + 171 ", sourceInventoryTransactionPK=" + getSourceInventoryTransactionPK() + 172 ", destinationInventoryTransactionPK=" + getDestinationInventoryTransactionPK() + 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 InventoryTransferTransactionDetailValue 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 InventoryTransferTransactionDetailValue that) { 209 boolean objectsEqual = true; 210 211 212 if(objectsEqual) { 213 InventoryTransferTransactionPK thisInventoryTransferTransactionPK = getInventoryTransferTransactionPK(); 214 InventoryTransferTransactionPK thatInventoryTransferTransactionPK = that.getInventoryTransferTransactionPK(); 215 216 if(thisInventoryTransferTransactionPK == null) { 217 objectsEqual = objectsEqual && (thatInventoryTransferTransactionPK == null); 218 } else { 219 objectsEqual = objectsEqual && thisInventoryTransferTransactionPK.equals(thatInventoryTransferTransactionPK); 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 thisInventoryTransferTransactionName = getInventoryTransferTransactionName(); 236 String thatInventoryTransferTransactionName = that.getInventoryTransferTransactionName(); 237 238 if(thisInventoryTransferTransactionName == null) { 239 objectsEqual = objectsEqual && (thatInventoryTransferTransactionName == null); 240 } else { 241 objectsEqual = objectsEqual && thisInventoryTransferTransactionName.equals(thatInventoryTransferTransactionName); 242 } 243 } 244 245 if(objectsEqual) { 246 InventoryTransactionPK thisSourceInventoryTransactionPK = getSourceInventoryTransactionPK(); 247 InventoryTransactionPK thatSourceInventoryTransactionPK = that.getSourceInventoryTransactionPK(); 248 249 if(thisSourceInventoryTransactionPK == null) { 250 objectsEqual = objectsEqual && (thatSourceInventoryTransactionPK == null); 251 } else { 252 objectsEqual = objectsEqual && thisSourceInventoryTransactionPK.equals(thatSourceInventoryTransactionPK); 253 } 254 } 255 256 if(objectsEqual) { 257 InventoryTransactionPK thisDestinationInventoryTransactionPK = getDestinationInventoryTransactionPK(); 258 InventoryTransactionPK thatDestinationInventoryTransactionPK = that.getDestinationInventoryTransactionPK(); 259 260 if(thisDestinationInventoryTransactionPK == null) { 261 objectsEqual = objectsEqual && (thatDestinationInventoryTransactionPK == null); 262 } else { 263 objectsEqual = objectsEqual && thisDestinationInventoryTransactionPK.equals(thatDestinationInventoryTransactionPK); 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 inventoryTransferTransactionPKHasBeenModified || inventoryTransactionTypePKHasBeenModified || inventoryTransferTransactionNameHasBeenModified || sourceInventoryTransactionPKHasBeenModified || destinationInventoryTransactionPKHasBeenModified || referenceHasBeenModified || descriptionHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 320 } 321 322 @Override 323 public void clearHasBeenModified() { 324 inventoryTransferTransactionPKHasBeenModified = false; 325 inventoryTransactionTypePKHasBeenModified = false; 326 inventoryTransferTransactionNameHasBeenModified = false; 327 sourceInventoryTransactionPKHasBeenModified = false; 328 destinationInventoryTransactionPKHasBeenModified = false; 329 referenceHasBeenModified = false; 330 descriptionHasBeenModified = false; 331 fromTimeHasBeenModified = false; 332 thruTimeHasBeenModified = false; 333 } 334 335 @Nonnull 336 public InventoryTransferTransactionPK getInventoryTransferTransactionPK() { 337 return inventoryTransferTransactionPK; 338 } 339 340 public void setInventoryTransferTransactionPK(@Nonnull InventoryTransferTransactionPK inventoryTransferTransactionPK) 341 throws PersistenceNotNullException { 342 checkForNull(inventoryTransferTransactionPK); 343 344 boolean update = true; 345 346 if(this.inventoryTransferTransactionPK != null) { 347 if(this.inventoryTransferTransactionPK.equals(inventoryTransferTransactionPK)) { 348 update = false; 349 } 350 } else if(inventoryTransferTransactionPK == null) { 351 update = false; 352 } 353 354 if(update) { 355 this.inventoryTransferTransactionPK = inventoryTransferTransactionPK; 356 inventoryTransferTransactionPKHasBeenModified = true; 357 clearHashAndString(); 358 } 359 } 360 361 public boolean getInventoryTransferTransactionPKHasBeenModified() { 362 return inventoryTransferTransactionPKHasBeenModified; 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 getInventoryTransferTransactionName() { 397 return inventoryTransferTransactionName; 398 } 399 400 public void setInventoryTransferTransactionName(@Nonnull String inventoryTransferTransactionName) 401 throws PersistenceNotNullException { 402 checkForNull(inventoryTransferTransactionName); 403 404 boolean update = true; 405 406 if(this.inventoryTransferTransactionName != null) { 407 if(this.inventoryTransferTransactionName.equals(inventoryTransferTransactionName)) { 408 update = false; 409 } 410 } else if(inventoryTransferTransactionName == null) { 411 update = false; 412 } 413 414 if(update) { 415 this.inventoryTransferTransactionName = inventoryTransferTransactionName; 416 inventoryTransferTransactionNameHasBeenModified = true; 417 clearHashAndString(); 418 } 419 } 420 421 public boolean getInventoryTransferTransactionNameHasBeenModified() { 422 return inventoryTransferTransactionNameHasBeenModified; 423 } 424 425 @Nonnull 426 public InventoryTransactionPK getSourceInventoryTransactionPK() { 427 return sourceInventoryTransactionPK; 428 } 429 430 public void setSourceInventoryTransactionPK(@Nonnull InventoryTransactionPK sourceInventoryTransactionPK) 431 throws PersistenceNotNullException { 432 checkForNull(sourceInventoryTransactionPK); 433 434 boolean update = true; 435 436 if(this.sourceInventoryTransactionPK != null) { 437 if(this.sourceInventoryTransactionPK.equals(sourceInventoryTransactionPK)) { 438 update = false; 439 } 440 } else if(sourceInventoryTransactionPK == null) { 441 update = false; 442 } 443 444 if(update) { 445 this.sourceInventoryTransactionPK = sourceInventoryTransactionPK; 446 sourceInventoryTransactionPKHasBeenModified = true; 447 clearHashAndString(); 448 } 449 } 450 451 public boolean getSourceInventoryTransactionPKHasBeenModified() { 452 return sourceInventoryTransactionPKHasBeenModified; 453 } 454 455 @Nonnull 456 public InventoryTransactionPK getDestinationInventoryTransactionPK() { 457 return destinationInventoryTransactionPK; 458 } 459 460 public void setDestinationInventoryTransactionPK(@Nonnull InventoryTransactionPK destinationInventoryTransactionPK) 461 throws PersistenceNotNullException { 462 checkForNull(destinationInventoryTransactionPK); 463 464 boolean update = true; 465 466 if(this.destinationInventoryTransactionPK != null) { 467 if(this.destinationInventoryTransactionPK.equals(destinationInventoryTransactionPK)) { 468 update = false; 469 } 470 } else if(destinationInventoryTransactionPK == null) { 471 update = false; 472 } 473 474 if(update) { 475 this.destinationInventoryTransactionPK = destinationInventoryTransactionPK; 476 destinationInventoryTransactionPKHasBeenModified = true; 477 clearHashAndString(); 478 } 479 } 480 481 public boolean getDestinationInventoryTransactionPKHasBeenModified() { 482 return destinationInventoryTransactionPKHasBeenModified; 483 } 484 485 @Nullable 486 public String getReference() { 487 return reference; 488 } 489 490 public void setReference(@Nullable String reference) { 491 boolean update = true; 492 493 if(this.reference != null) { 494 if(this.reference.equals(reference)) { 495 update = false; 496 } 497 } else if(reference == null) { 498 update = false; 499 } 500 501 if(update) { 502 this.reference = reference; 503 referenceHasBeenModified = true; 504 clearHashAndString(); 505 } 506 } 507 508 public boolean getReferenceHasBeenModified() { 509 return referenceHasBeenModified; 510 } 511 512 @Nullable 513 public String getDescription() { 514 return description; 515 } 516 517 public void setDescription(@Nullable String description) { 518 boolean update = true; 519 520 if(this.description != null) { 521 if(this.description.equals(description)) { 522 update = false; 523 } 524 } else if(description == null) { 525 update = false; 526 } 527 528 if(update) { 529 this.description = description; 530 descriptionHasBeenModified = true; 531 clearHashAndString(); 532 } 533 } 534 535 public boolean getDescriptionHasBeenModified() { 536 return descriptionHasBeenModified; 537 } 538 539 @Nonnull 540 public Long getFromTime() { 541 return fromTime; 542 } 543 544 public void setFromTime(@Nonnull Long fromTime) 545 throws PersistenceNotNullException { 546 checkForNull(fromTime); 547 548 boolean update = true; 549 550 if(this.fromTime != null) { 551 if(this.fromTime.equals(fromTime)) { 552 update = false; 553 } 554 } else if(fromTime == null) { 555 update = false; 556 } 557 558 if(update) { 559 this.fromTime = fromTime; 560 fromTimeHasBeenModified = true; 561 clearHashAndString(); 562 } 563 } 564 565 public boolean getFromTimeHasBeenModified() { 566 return fromTimeHasBeenModified; 567 } 568 569 @Nonnull 570 public Long getThruTime() { 571 return thruTime; 572 } 573 574 public void setThruTime(@Nonnull Long thruTime) 575 throws PersistenceNotNullException { 576 checkForNull(thruTime); 577 578 boolean update = true; 579 580 if(this.thruTime != null) { 581 if(this.thruTime.equals(thruTime)) { 582 update = false; 583 } 584 } else if(thruTime == null) { 585 update = false; 586 } 587 588 if(update) { 589 this.thruTime = thruTime; 590 thruTimeHasBeenModified = true; 591 clearHashAndString(); 592 } 593 } 594 595 public boolean getThruTimeHasBeenModified() { 596 return thruTimeHasBeenModified; 597 } 598 599}