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 * FinancialAccountTransactionDetailValue.java 021 */ 022 023package com.echothree.model.data.financial.server.value; 024 025import com.echothree.model.data.financial.common.pk.FinancialAccountTransactionDetailPK; 026 027import com.echothree.model.data.financial.server.factory.FinancialAccountTransactionDetailFactory; 028 029import com.echothree.model.data.financial.common.pk.FinancialAccountTransactionPK; 030import com.echothree.model.data.financial.common.pk.FinancialAccountPK; 031import com.echothree.model.data.financial.common.pk.FinancialAccountTransactionTypePK; 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 FinancialAccountTransactionDetailValue 044 extends BaseValue<FinancialAccountTransactionDetailPK> 045 implements Cloneable, Serializable { 046 047 private FinancialAccountTransactionPK financialAccountTransactionPK; 048 private boolean financialAccountTransactionPKHasBeenModified = false; 049 private String financialAccountTransactionName; 050 private boolean financialAccountTransactionNameHasBeenModified = false; 051 private FinancialAccountPK financialAccountPK; 052 private boolean financialAccountPKHasBeenModified = false; 053 private FinancialAccountTransactionTypePK financialAccountTransactionTypePK; 054 private boolean financialAccountTransactionTypePKHasBeenModified = false; 055 private Long amount; 056 private boolean amountHasBeenModified = false; 057 private String comment; 058 private boolean commentHasBeenModified = false; 059 private Long fromTime; 060 private boolean fromTimeHasBeenModified = false; 061 private Long thruTime; 062 private boolean thruTimeHasBeenModified = false; 063 064 private transient Integer _hashCode = null; 065 private transient String _stringValue = null; 066 067 private void constructFields(FinancialAccountTransactionPK financialAccountTransactionPK, String financialAccountTransactionName, FinancialAccountPK financialAccountPK, FinancialAccountTransactionTypePK financialAccountTransactionTypePK, Long amount, String comment, Long fromTime, Long thruTime) 068 throws PersistenceNotNullException { 069 checkForNull(financialAccountTransactionPK); 070 this.financialAccountTransactionPK = financialAccountTransactionPK; 071 checkForNull(financialAccountTransactionName); 072 this.financialAccountTransactionName = financialAccountTransactionName; 073 checkForNull(financialAccountPK); 074 this.financialAccountPK = financialAccountPK; 075 checkForNull(financialAccountTransactionTypePK); 076 this.financialAccountTransactionTypePK = financialAccountTransactionTypePK; 077 checkForNull(amount); 078 this.amount = amount; 079 this.comment = comment; 080 checkForNull(fromTime); 081 this.fromTime = fromTime; 082 checkForNull(thruTime); 083 this.thruTime = thruTime; 084 } 085 086 /** Creates a new instance of FinancialAccountTransactionDetailValue */ 087 public FinancialAccountTransactionDetailValue(FinancialAccountTransactionDetailPK financialAccountTransactionDetailPK, FinancialAccountTransactionPK financialAccountTransactionPK, String financialAccountTransactionName, FinancialAccountPK financialAccountPK, FinancialAccountTransactionTypePK financialAccountTransactionTypePK, Long amount, String comment, Long fromTime, Long thruTime) 088 throws PersistenceNotNullException { 089 super(financialAccountTransactionDetailPK); 090 constructFields(financialAccountTransactionPK, financialAccountTransactionName, financialAccountPK, financialAccountTransactionTypePK, amount, comment, fromTime, thruTime); 091 } 092 093 /** Creates a new instance of FinancialAccountTransactionDetailValue */ 094 public FinancialAccountTransactionDetailValue(FinancialAccountTransactionPK financialAccountTransactionPK, String financialAccountTransactionName, FinancialAccountPK financialAccountPK, FinancialAccountTransactionTypePK financialAccountTransactionTypePK, Long amount, String comment, Long fromTime, Long thruTime) 095 throws PersistenceNotNullException { 096 super(); 097 constructFields(financialAccountTransactionPK, financialAccountTransactionName, financialAccountPK, financialAccountTransactionTypePK, amount, comment, fromTime, thruTime); 098 } 099 100 @Override 101 @Nonnull 102 public FinancialAccountTransactionDetailFactory getBaseFactoryInstance() { 103 return FinancialAccountTransactionDetailFactory.getInstance(); 104 } 105 106 @Override 107 @Nonnull 108 public FinancialAccountTransactionDetailValue clone() { 109 Object result; 110 111 try { 112 result = super.clone(); 113 } catch (CloneNotSupportedException cnse) { 114 // This shouldn't happen, fail when it does. 115 throw new PersistenceCloneException(cnse); 116 } 117 118 return (FinancialAccountTransactionDetailValue)result; 119 } 120 121 @Override 122 @Nonnull 123 public FinancialAccountTransactionDetailPK getPrimaryKey() { 124 if(_primaryKey == null) { 125 _primaryKey = new FinancialAccountTransactionDetailPK(entityId); 126 } 127 128 return _primaryKey; 129 } 130 131 private void clearHashAndString() { 132 _hashCode = null; 133 _stringValue = null; 134 } 135 136 @Override 137 public int hashCode() { 138 if(_hashCode == null) { 139 int hashCode = 17; 140 141 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 142 143 hashCode = 37 * hashCode + ((financialAccountTransactionPK != null) ? financialAccountTransactionPK.hashCode() : 0); 144 hashCode = 37 * hashCode + ((financialAccountTransactionName != null) ? financialAccountTransactionName.hashCode() : 0); 145 hashCode = 37 * hashCode + ((financialAccountPK != null) ? financialAccountPK.hashCode() : 0); 146 hashCode = 37 * hashCode + ((financialAccountTransactionTypePK != null) ? financialAccountTransactionTypePK.hashCode() : 0); 147 hashCode = 37 * hashCode + ((amount != null) ? amount.hashCode() : 0); 148 hashCode = 37 * hashCode + ((comment != null) ? comment.hashCode() : 0); 149 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 150 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 151 152 _hashCode = hashCode; 153 } 154 155 return _hashCode; 156 } 157 158 @Override 159 @Nonnull 160 public String toString() { 161 if(_stringValue == null) { 162 _stringValue = "{" + 163 "entityId=" + getEntityId() + 164 ", financialAccountTransactionPK=" + getFinancialAccountTransactionPK() + 165 ", financialAccountTransactionName=" + getFinancialAccountTransactionName() + 166 ", financialAccountPK=" + getFinancialAccountPK() + 167 ", financialAccountTransactionTypePK=" + getFinancialAccountTransactionTypePK() + 168 ", amount=" + getAmount() + 169 ", comment=" + getComment() + 170 ", fromTime=" + getFromTime() + 171 ", thruTime=" + getThruTime() + 172 "}"; 173 } 174 return _stringValue; 175 } 176 177 @Override 178 public boolean equals(Object other) { 179 if(this == other) 180 return true; 181 182 if(!hasIdentity()) 183 return false; 184 185 if(other instanceof FinancialAccountTransactionDetailValue that) { 186 if(!that.hasIdentity()) 187 return false; 188 189 Long thisEntityId = getEntityId(); 190 Long thatEntityId = that.getEntityId(); 191 192 boolean objectsEqual = thisEntityId.equals(thatEntityId); 193 if(objectsEqual) 194 objectsEqual = isIdentical(that); 195 196 return objectsEqual; 197 } else { 198 return false; 199 } 200 } 201 202 public boolean isIdentical(Object other) { 203 if(other instanceof FinancialAccountTransactionDetailValue that) { 204 boolean objectsEqual = true; 205 206 207 if(objectsEqual) { 208 FinancialAccountTransactionPK thisFinancialAccountTransactionPK = getFinancialAccountTransactionPK(); 209 FinancialAccountTransactionPK thatFinancialAccountTransactionPK = that.getFinancialAccountTransactionPK(); 210 211 if(thisFinancialAccountTransactionPK == null) { 212 objectsEqual = objectsEqual && (thatFinancialAccountTransactionPK == null); 213 } else { 214 objectsEqual = objectsEqual && thisFinancialAccountTransactionPK.equals(thatFinancialAccountTransactionPK); 215 } 216 } 217 218 if(objectsEqual) { 219 String thisFinancialAccountTransactionName = getFinancialAccountTransactionName(); 220 String thatFinancialAccountTransactionName = that.getFinancialAccountTransactionName(); 221 222 if(thisFinancialAccountTransactionName == null) { 223 objectsEqual = objectsEqual && (thatFinancialAccountTransactionName == null); 224 } else { 225 objectsEqual = objectsEqual && thisFinancialAccountTransactionName.equals(thatFinancialAccountTransactionName); 226 } 227 } 228 229 if(objectsEqual) { 230 FinancialAccountPK thisFinancialAccountPK = getFinancialAccountPK(); 231 FinancialAccountPK thatFinancialAccountPK = that.getFinancialAccountPK(); 232 233 if(thisFinancialAccountPK == null) { 234 objectsEqual = objectsEqual && (thatFinancialAccountPK == null); 235 } else { 236 objectsEqual = objectsEqual && thisFinancialAccountPK.equals(thatFinancialAccountPK); 237 } 238 } 239 240 if(objectsEqual) { 241 FinancialAccountTransactionTypePK thisFinancialAccountTransactionTypePK = getFinancialAccountTransactionTypePK(); 242 FinancialAccountTransactionTypePK thatFinancialAccountTransactionTypePK = that.getFinancialAccountTransactionTypePK(); 243 244 if(thisFinancialAccountTransactionTypePK == null) { 245 objectsEqual = objectsEqual && (thatFinancialAccountTransactionTypePK == null); 246 } else { 247 objectsEqual = objectsEqual && thisFinancialAccountTransactionTypePK.equals(thatFinancialAccountTransactionTypePK); 248 } 249 } 250 251 if(objectsEqual) { 252 Long thisAmount = getAmount(); 253 Long thatAmount = that.getAmount(); 254 255 if(thisAmount == null) { 256 objectsEqual = objectsEqual && (thatAmount == null); 257 } else { 258 objectsEqual = objectsEqual && thisAmount.equals(thatAmount); 259 } 260 } 261 262 if(objectsEqual) { 263 String thisComment = getComment(); 264 String thatComment = that.getComment(); 265 266 if(thisComment == null) { 267 objectsEqual = objectsEqual && (thatComment == null); 268 } else { 269 objectsEqual = objectsEqual && thisComment.equals(thatComment); 270 } 271 } 272 273 if(objectsEqual) { 274 Long thisFromTime = getFromTime(); 275 Long thatFromTime = that.getFromTime(); 276 277 if(thisFromTime == null) { 278 objectsEqual = objectsEqual && (thatFromTime == null); 279 } else { 280 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 281 } 282 } 283 284 if(objectsEqual) { 285 Long thisThruTime = getThruTime(); 286 Long thatThruTime = that.getThruTime(); 287 288 if(thisThruTime == null) { 289 objectsEqual = objectsEqual && (thatThruTime == null); 290 } else { 291 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 292 } 293 } 294 295 return objectsEqual; 296 } else { 297 return false; 298 } 299 } 300 301 @Override 302 public boolean hasBeenModified() { 303 return financialAccountTransactionPKHasBeenModified || financialAccountTransactionNameHasBeenModified || financialAccountPKHasBeenModified || financialAccountTransactionTypePKHasBeenModified || amountHasBeenModified || commentHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 304 } 305 306 @Override 307 public void clearHasBeenModified() { 308 financialAccountTransactionPKHasBeenModified = false; 309 financialAccountTransactionNameHasBeenModified = false; 310 financialAccountPKHasBeenModified = false; 311 financialAccountTransactionTypePKHasBeenModified = false; 312 amountHasBeenModified = false; 313 commentHasBeenModified = false; 314 fromTimeHasBeenModified = false; 315 thruTimeHasBeenModified = false; 316 } 317 318 @Nonnull 319 public FinancialAccountTransactionPK getFinancialAccountTransactionPK() { 320 return financialAccountTransactionPK; 321 } 322 323 public void setFinancialAccountTransactionPK(@Nonnull FinancialAccountTransactionPK financialAccountTransactionPK) 324 throws PersistenceNotNullException { 325 checkForNull(financialAccountTransactionPK); 326 327 boolean update = true; 328 329 if(this.financialAccountTransactionPK != null) { 330 if(this.financialAccountTransactionPK.equals(financialAccountTransactionPK)) { 331 update = false; 332 } 333 } else if(financialAccountTransactionPK == null) { 334 update = false; 335 } 336 337 if(update) { 338 this.financialAccountTransactionPK = financialAccountTransactionPK; 339 financialAccountTransactionPKHasBeenModified = true; 340 clearHashAndString(); 341 } 342 } 343 344 public boolean getFinancialAccountTransactionPKHasBeenModified() { 345 return financialAccountTransactionPKHasBeenModified; 346 } 347 348 @Nonnull 349 public String getFinancialAccountTransactionName() { 350 return financialAccountTransactionName; 351 } 352 353 public void setFinancialAccountTransactionName(@Nonnull String financialAccountTransactionName) 354 throws PersistenceNotNullException { 355 checkForNull(financialAccountTransactionName); 356 357 boolean update = true; 358 359 if(this.financialAccountTransactionName != null) { 360 if(this.financialAccountTransactionName.equals(financialAccountTransactionName)) { 361 update = false; 362 } 363 } else if(financialAccountTransactionName == null) { 364 update = false; 365 } 366 367 if(update) { 368 this.financialAccountTransactionName = financialAccountTransactionName; 369 financialAccountTransactionNameHasBeenModified = true; 370 clearHashAndString(); 371 } 372 } 373 374 public boolean getFinancialAccountTransactionNameHasBeenModified() { 375 return financialAccountTransactionNameHasBeenModified; 376 } 377 378 @Nonnull 379 public FinancialAccountPK getFinancialAccountPK() { 380 return financialAccountPK; 381 } 382 383 public void setFinancialAccountPK(@Nonnull FinancialAccountPK financialAccountPK) 384 throws PersistenceNotNullException { 385 checkForNull(financialAccountPK); 386 387 boolean update = true; 388 389 if(this.financialAccountPK != null) { 390 if(this.financialAccountPK.equals(financialAccountPK)) { 391 update = false; 392 } 393 } else if(financialAccountPK == null) { 394 update = false; 395 } 396 397 if(update) { 398 this.financialAccountPK = financialAccountPK; 399 financialAccountPKHasBeenModified = true; 400 clearHashAndString(); 401 } 402 } 403 404 public boolean getFinancialAccountPKHasBeenModified() { 405 return financialAccountPKHasBeenModified; 406 } 407 408 @Nonnull 409 public FinancialAccountTransactionTypePK getFinancialAccountTransactionTypePK() { 410 return financialAccountTransactionTypePK; 411 } 412 413 public void setFinancialAccountTransactionTypePK(@Nonnull FinancialAccountTransactionTypePK financialAccountTransactionTypePK) 414 throws PersistenceNotNullException { 415 checkForNull(financialAccountTransactionTypePK); 416 417 boolean update = true; 418 419 if(this.financialAccountTransactionTypePK != null) { 420 if(this.financialAccountTransactionTypePK.equals(financialAccountTransactionTypePK)) { 421 update = false; 422 } 423 } else if(financialAccountTransactionTypePK == null) { 424 update = false; 425 } 426 427 if(update) { 428 this.financialAccountTransactionTypePK = financialAccountTransactionTypePK; 429 financialAccountTransactionTypePKHasBeenModified = true; 430 clearHashAndString(); 431 } 432 } 433 434 public boolean getFinancialAccountTransactionTypePKHasBeenModified() { 435 return financialAccountTransactionTypePKHasBeenModified; 436 } 437 438 @Nonnull 439 public Long getAmount() { 440 return amount; 441 } 442 443 public void setAmount(@Nonnull Long amount) 444 throws PersistenceNotNullException { 445 checkForNull(amount); 446 447 boolean update = true; 448 449 if(this.amount != null) { 450 if(this.amount.equals(amount)) { 451 update = false; 452 } 453 } else if(amount == null) { 454 update = false; 455 } 456 457 if(update) { 458 this.amount = amount; 459 amountHasBeenModified = true; 460 clearHashAndString(); 461 } 462 } 463 464 public boolean getAmountHasBeenModified() { 465 return amountHasBeenModified; 466 } 467 468 @Nullable 469 public String getComment() { 470 return comment; 471 } 472 473 public void setComment(@Nullable String comment) { 474 boolean update = true; 475 476 if(this.comment != null) { 477 if(this.comment.equals(comment)) { 478 update = false; 479 } 480 } else if(comment == null) { 481 update = false; 482 } 483 484 if(update) { 485 this.comment = comment; 486 commentHasBeenModified = true; 487 clearHashAndString(); 488 } 489 } 490 491 public boolean getCommentHasBeenModified() { 492 return commentHasBeenModified; 493 } 494 495 @Nonnull 496 public Long getFromTime() { 497 return fromTime; 498 } 499 500 public void setFromTime(@Nonnull Long fromTime) 501 throws PersistenceNotNullException { 502 checkForNull(fromTime); 503 504 boolean update = true; 505 506 if(this.fromTime != null) { 507 if(this.fromTime.equals(fromTime)) { 508 update = false; 509 } 510 } else if(fromTime == null) { 511 update = false; 512 } 513 514 if(update) { 515 this.fromTime = fromTime; 516 fromTimeHasBeenModified = true; 517 clearHashAndString(); 518 } 519 } 520 521 public boolean getFromTimeHasBeenModified() { 522 return fromTimeHasBeenModified; 523 } 524 525 @Nonnull 526 public Long getThruTime() { 527 return thruTime; 528 } 529 530 public void setThruTime(@Nonnull Long thruTime) 531 throws PersistenceNotNullException { 532 checkForNull(thruTime); 533 534 boolean update = true; 535 536 if(this.thruTime != null) { 537 if(this.thruTime.equals(thruTime)) { 538 update = false; 539 } 540 } else if(thruTime == null) { 541 update = false; 542 } 543 544 if(update) { 545 this.thruTime = thruTime; 546 thruTimeHasBeenModified = true; 547 clearHashAndString(); 548 } 549 } 550 551 public boolean getThruTimeHasBeenModified() { 552 return thruTimeHasBeenModified; 553 } 554 555}