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 * EntityIntegerRangeDetailValue.java 021 */ 022 023package com.echothree.model.data.core.server.value; 024 025import com.echothree.model.data.core.common.pk.EntityIntegerRangeDetailPK; 026 027import com.echothree.model.data.core.server.factory.EntityIntegerRangeDetailFactory; 028 029import com.echothree.model.data.core.common.pk.EntityIntegerRangePK; 030import com.echothree.model.data.core.common.pk.EntityAttributePK; 031 032import com.echothree.util.common.exception.PersistenceCloneException; 033import com.echothree.util.common.exception.PersistenceNotNullException; 034 035import com.echothree.util.server.persistence.BaseValue; 036 037import java.io.Serializable; 038 039import javax.annotation.Nonnull; 040import javax.annotation.Nullable; 041 042public class EntityIntegerRangeDetailValue 043 extends BaseValue<EntityIntegerRangeDetailPK> 044 implements Cloneable, Serializable { 045 046 private EntityIntegerRangePK entityIntegerRangePK; 047 private boolean entityIntegerRangePKHasBeenModified = false; 048 private EntityAttributePK entityAttributePK; 049 private boolean entityAttributePKHasBeenModified = false; 050 private String entityIntegerRangeName; 051 private boolean entityIntegerRangeNameHasBeenModified = false; 052 private Integer minimumIntegerValue; 053 private boolean minimumIntegerValueHasBeenModified = false; 054 private Integer maximumIntegerValue; 055 private boolean maximumIntegerValueHasBeenModified = false; 056 private Boolean isDefault; 057 private boolean isDefaultHasBeenModified = false; 058 private Integer sortOrder; 059 private boolean sortOrderHasBeenModified = false; 060 private Long fromTime; 061 private boolean fromTimeHasBeenModified = false; 062 private Long thruTime; 063 private boolean thruTimeHasBeenModified = false; 064 065 private transient Integer _hashCode = null; 066 private transient String _stringValue = null; 067 068 private void constructFields(EntityIntegerRangePK entityIntegerRangePK, EntityAttributePK entityAttributePK, String entityIntegerRangeName, Integer minimumIntegerValue, Integer maximumIntegerValue, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 069 throws PersistenceNotNullException { 070 checkForNull(entityIntegerRangePK); 071 this.entityIntegerRangePK = entityIntegerRangePK; 072 checkForNull(entityAttributePK); 073 this.entityAttributePK = entityAttributePK; 074 checkForNull(entityIntegerRangeName); 075 this.entityIntegerRangeName = entityIntegerRangeName; 076 this.minimumIntegerValue = minimumIntegerValue; 077 this.maximumIntegerValue = maximumIntegerValue; 078 checkForNull(isDefault); 079 this.isDefault = isDefault; 080 checkForNull(sortOrder); 081 this.sortOrder = sortOrder; 082 checkForNull(fromTime); 083 this.fromTime = fromTime; 084 checkForNull(thruTime); 085 this.thruTime = thruTime; 086 } 087 088 /** Creates a new instance of EntityIntegerRangeDetailValue */ 089 public EntityIntegerRangeDetailValue(EntityIntegerRangeDetailPK entityIntegerRangeDetailPK, EntityIntegerRangePK entityIntegerRangePK, EntityAttributePK entityAttributePK, String entityIntegerRangeName, Integer minimumIntegerValue, Integer maximumIntegerValue, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 090 throws PersistenceNotNullException { 091 super(entityIntegerRangeDetailPK); 092 constructFields(entityIntegerRangePK, entityAttributePK, entityIntegerRangeName, minimumIntegerValue, maximumIntegerValue, isDefault, sortOrder, fromTime, thruTime); 093 } 094 095 /** Creates a new instance of EntityIntegerRangeDetailValue */ 096 public EntityIntegerRangeDetailValue(EntityIntegerRangePK entityIntegerRangePK, EntityAttributePK entityAttributePK, String entityIntegerRangeName, Integer minimumIntegerValue, Integer maximumIntegerValue, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 097 throws PersistenceNotNullException { 098 super(); 099 constructFields(entityIntegerRangePK, entityAttributePK, entityIntegerRangeName, minimumIntegerValue, maximumIntegerValue, isDefault, sortOrder, fromTime, thruTime); 100 } 101 102 @Override 103 @Nonnull 104 public EntityIntegerRangeDetailFactory getBaseFactoryInstance() { 105 return EntityIntegerRangeDetailFactory.getInstance(); 106 } 107 108 @Override 109 @Nonnull 110 public EntityIntegerRangeDetailValue 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 (EntityIntegerRangeDetailValue)result; 121 } 122 123 @Override 124 @Nonnull 125 public EntityIntegerRangeDetailPK getPrimaryKey() { 126 if(_primaryKey == null) { 127 _primaryKey = new EntityIntegerRangeDetailPK(entityId); 128 } 129 130 return _primaryKey; 131 } 132 133 private void clearHashAndString() { 134 _hashCode = null; 135 _stringValue = null; 136 } 137 138 @Override 139 public int hashCode() { 140 if(_hashCode == null) { 141 int hashCode = 17; 142 143 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 144 145 hashCode = 37 * hashCode + ((entityIntegerRangePK != null) ? entityIntegerRangePK.hashCode() : 0); 146 hashCode = 37 * hashCode + ((entityAttributePK != null) ? entityAttributePK.hashCode() : 0); 147 hashCode = 37 * hashCode + ((entityIntegerRangeName != null) ? entityIntegerRangeName.hashCode() : 0); 148 hashCode = 37 * hashCode + ((minimumIntegerValue != null) ? minimumIntegerValue.hashCode() : 0); 149 hashCode = 37 * hashCode + ((maximumIntegerValue != null) ? maximumIntegerValue.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 @Nonnull 163 public String toString() { 164 if(_stringValue == null) { 165 _stringValue = "{" + 166 "entityId=" + getEntityId() + 167 ", entityIntegerRangePK=" + getEntityIntegerRangePK() + 168 ", entityAttributePK=" + getEntityAttributePK() + 169 ", entityIntegerRangeName=" + getEntityIntegerRangeName() + 170 ", minimumIntegerValue=" + getMinimumIntegerValue() + 171 ", maximumIntegerValue=" + getMaximumIntegerValue() + 172 ", isDefault=" + getIsDefault() + 173 ", sortOrder=" + getSortOrder() + 174 ", fromTime=" + getFromTime() + 175 ", thruTime=" + getThruTime() + 176 "}"; 177 } 178 return _stringValue; 179 } 180 181 @Override 182 public boolean equals(Object other) { 183 if(this == other) 184 return true; 185 186 if(!hasIdentity()) 187 return false; 188 189 if(other instanceof EntityIntegerRangeDetailValue that) { 190 if(!that.hasIdentity()) 191 return false; 192 193 Long thisEntityId = getEntityId(); 194 Long thatEntityId = that.getEntityId(); 195 196 boolean objectsEqual = thisEntityId.equals(thatEntityId); 197 if(objectsEqual) 198 objectsEqual = isIdentical(that); 199 200 return objectsEqual; 201 } else { 202 return false; 203 } 204 } 205 206 public boolean isIdentical(Object other) { 207 if(other instanceof EntityIntegerRangeDetailValue that) { 208 boolean objectsEqual = true; 209 210 211 if(objectsEqual) { 212 EntityIntegerRangePK thisEntityIntegerRangePK = getEntityIntegerRangePK(); 213 EntityIntegerRangePK thatEntityIntegerRangePK = that.getEntityIntegerRangePK(); 214 215 if(thisEntityIntegerRangePK == null) { 216 objectsEqual = objectsEqual && (thatEntityIntegerRangePK == null); 217 } else { 218 objectsEqual = objectsEqual && thisEntityIntegerRangePK.equals(thatEntityIntegerRangePK); 219 } 220 } 221 222 if(objectsEqual) { 223 EntityAttributePK thisEntityAttributePK = getEntityAttributePK(); 224 EntityAttributePK thatEntityAttributePK = that.getEntityAttributePK(); 225 226 if(thisEntityAttributePK == null) { 227 objectsEqual = objectsEqual && (thatEntityAttributePK == null); 228 } else { 229 objectsEqual = objectsEqual && thisEntityAttributePK.equals(thatEntityAttributePK); 230 } 231 } 232 233 if(objectsEqual) { 234 String thisEntityIntegerRangeName = getEntityIntegerRangeName(); 235 String thatEntityIntegerRangeName = that.getEntityIntegerRangeName(); 236 237 if(thisEntityIntegerRangeName == null) { 238 objectsEqual = objectsEqual && (thatEntityIntegerRangeName == null); 239 } else { 240 objectsEqual = objectsEqual && thisEntityIntegerRangeName.equals(thatEntityIntegerRangeName); 241 } 242 } 243 244 if(objectsEqual) { 245 Integer thisMinimumIntegerValue = getMinimumIntegerValue(); 246 Integer thatMinimumIntegerValue = that.getMinimumIntegerValue(); 247 248 if(thisMinimumIntegerValue == null) { 249 objectsEqual = objectsEqual && (thatMinimumIntegerValue == null); 250 } else { 251 objectsEqual = objectsEqual && thisMinimumIntegerValue.equals(thatMinimumIntegerValue); 252 } 253 } 254 255 if(objectsEqual) { 256 Integer thisMaximumIntegerValue = getMaximumIntegerValue(); 257 Integer thatMaximumIntegerValue = that.getMaximumIntegerValue(); 258 259 if(thisMaximumIntegerValue == null) { 260 objectsEqual = objectsEqual && (thatMaximumIntegerValue == null); 261 } else { 262 objectsEqual = objectsEqual && thisMaximumIntegerValue.equals(thatMaximumIntegerValue); 263 } 264 } 265 266 if(objectsEqual) { 267 Boolean thisIsDefault = getIsDefault(); 268 Boolean thatIsDefault = that.getIsDefault(); 269 270 if(thisIsDefault == null) { 271 objectsEqual = objectsEqual && (thatIsDefault == null); 272 } else { 273 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 274 } 275 } 276 277 if(objectsEqual) { 278 Integer thisSortOrder = getSortOrder(); 279 Integer thatSortOrder = that.getSortOrder(); 280 281 if(thisSortOrder == null) { 282 objectsEqual = objectsEqual && (thatSortOrder == null); 283 } else { 284 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 285 } 286 } 287 288 if(objectsEqual) { 289 Long thisFromTime = getFromTime(); 290 Long thatFromTime = that.getFromTime(); 291 292 if(thisFromTime == null) { 293 objectsEqual = objectsEqual && (thatFromTime == null); 294 } else { 295 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 296 } 297 } 298 299 if(objectsEqual) { 300 Long thisThruTime = getThruTime(); 301 Long thatThruTime = that.getThruTime(); 302 303 if(thisThruTime == null) { 304 objectsEqual = objectsEqual && (thatThruTime == null); 305 } else { 306 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 307 } 308 } 309 310 return objectsEqual; 311 } else { 312 return false; 313 } 314 } 315 316 @Override 317 public boolean hasBeenModified() { 318 return entityIntegerRangePKHasBeenModified || entityAttributePKHasBeenModified || entityIntegerRangeNameHasBeenModified || minimumIntegerValueHasBeenModified || maximumIntegerValueHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 319 } 320 321 @Override 322 public void clearHasBeenModified() { 323 entityIntegerRangePKHasBeenModified = false; 324 entityAttributePKHasBeenModified = false; 325 entityIntegerRangeNameHasBeenModified = false; 326 minimumIntegerValueHasBeenModified = false; 327 maximumIntegerValueHasBeenModified = false; 328 isDefaultHasBeenModified = false; 329 sortOrderHasBeenModified = false; 330 fromTimeHasBeenModified = false; 331 thruTimeHasBeenModified = false; 332 } 333 334 @Nonnull 335 public EntityIntegerRangePK getEntityIntegerRangePK() { 336 return entityIntegerRangePK; 337 } 338 339 public void setEntityIntegerRangePK(@Nonnull EntityIntegerRangePK entityIntegerRangePK) 340 throws PersistenceNotNullException { 341 checkForNull(entityIntegerRangePK); 342 343 boolean update = true; 344 345 if(this.entityIntegerRangePK != null) { 346 if(this.entityIntegerRangePK.equals(entityIntegerRangePK)) { 347 update = false; 348 } 349 } else if(entityIntegerRangePK == null) { 350 update = false; 351 } 352 353 if(update) { 354 this.entityIntegerRangePK = entityIntegerRangePK; 355 entityIntegerRangePKHasBeenModified = true; 356 clearHashAndString(); 357 } 358 } 359 360 public boolean getEntityIntegerRangePKHasBeenModified() { 361 return entityIntegerRangePKHasBeenModified; 362 } 363 364 @Nonnull 365 public EntityAttributePK getEntityAttributePK() { 366 return entityAttributePK; 367 } 368 369 public void setEntityAttributePK(@Nonnull EntityAttributePK entityAttributePK) 370 throws PersistenceNotNullException { 371 checkForNull(entityAttributePK); 372 373 boolean update = true; 374 375 if(this.entityAttributePK != null) { 376 if(this.entityAttributePK.equals(entityAttributePK)) { 377 update = false; 378 } 379 } else if(entityAttributePK == null) { 380 update = false; 381 } 382 383 if(update) { 384 this.entityAttributePK = entityAttributePK; 385 entityAttributePKHasBeenModified = true; 386 clearHashAndString(); 387 } 388 } 389 390 public boolean getEntityAttributePKHasBeenModified() { 391 return entityAttributePKHasBeenModified; 392 } 393 394 @Nonnull 395 public String getEntityIntegerRangeName() { 396 return entityIntegerRangeName; 397 } 398 399 public void setEntityIntegerRangeName(@Nonnull String entityIntegerRangeName) 400 throws PersistenceNotNullException { 401 checkForNull(entityIntegerRangeName); 402 403 boolean update = true; 404 405 if(this.entityIntegerRangeName != null) { 406 if(this.entityIntegerRangeName.equals(entityIntegerRangeName)) { 407 update = false; 408 } 409 } else if(entityIntegerRangeName == null) { 410 update = false; 411 } 412 413 if(update) { 414 this.entityIntegerRangeName = entityIntegerRangeName; 415 entityIntegerRangeNameHasBeenModified = true; 416 clearHashAndString(); 417 } 418 } 419 420 public boolean getEntityIntegerRangeNameHasBeenModified() { 421 return entityIntegerRangeNameHasBeenModified; 422 } 423 424 @Nullable 425 public Integer getMinimumIntegerValue() { 426 return minimumIntegerValue; 427 } 428 429 public void setMinimumIntegerValue(@Nullable Integer minimumIntegerValue) { 430 boolean update = true; 431 432 if(this.minimumIntegerValue != null) { 433 if(this.minimumIntegerValue.equals(minimumIntegerValue)) { 434 update = false; 435 } 436 } else if(minimumIntegerValue == null) { 437 update = false; 438 } 439 440 if(update) { 441 this.minimumIntegerValue = minimumIntegerValue; 442 minimumIntegerValueHasBeenModified = true; 443 clearHashAndString(); 444 } 445 } 446 447 public boolean getMinimumIntegerValueHasBeenModified() { 448 return minimumIntegerValueHasBeenModified; 449 } 450 451 @Nullable 452 public Integer getMaximumIntegerValue() { 453 return maximumIntegerValue; 454 } 455 456 public void setMaximumIntegerValue(@Nullable Integer maximumIntegerValue) { 457 boolean update = true; 458 459 if(this.maximumIntegerValue != null) { 460 if(this.maximumIntegerValue.equals(maximumIntegerValue)) { 461 update = false; 462 } 463 } else if(maximumIntegerValue == null) { 464 update = false; 465 } 466 467 if(update) { 468 this.maximumIntegerValue = maximumIntegerValue; 469 maximumIntegerValueHasBeenModified = true; 470 clearHashAndString(); 471 } 472 } 473 474 public boolean getMaximumIntegerValueHasBeenModified() { 475 return maximumIntegerValueHasBeenModified; 476 } 477 478 @Nonnull 479 public Boolean getIsDefault() { 480 return isDefault; 481 } 482 483 public void setIsDefault(@Nonnull Boolean isDefault) 484 throws PersistenceNotNullException { 485 checkForNull(isDefault); 486 487 boolean update = true; 488 489 if(this.isDefault != null) { 490 if(this.isDefault.equals(isDefault)) { 491 update = false; 492 } 493 } else if(isDefault == null) { 494 update = false; 495 } 496 497 if(update) { 498 this.isDefault = isDefault; 499 isDefaultHasBeenModified = true; 500 clearHashAndString(); 501 } 502 } 503 504 public boolean getIsDefaultHasBeenModified() { 505 return isDefaultHasBeenModified; 506 } 507 508 @Nonnull 509 public Integer getSortOrder() { 510 return sortOrder; 511 } 512 513 public void setSortOrder(@Nonnull Integer sortOrder) 514 throws PersistenceNotNullException { 515 checkForNull(sortOrder); 516 517 boolean update = true; 518 519 if(this.sortOrder != null) { 520 if(this.sortOrder.equals(sortOrder)) { 521 update = false; 522 } 523 } else if(sortOrder == null) { 524 update = false; 525 } 526 527 if(update) { 528 this.sortOrder = sortOrder; 529 sortOrderHasBeenModified = true; 530 clearHashAndString(); 531 } 532 } 533 534 public boolean getSortOrderHasBeenModified() { 535 return sortOrderHasBeenModified; 536 } 537 538 @Nonnull 539 public Long getFromTime() { 540 return fromTime; 541 } 542 543 public void setFromTime(@Nonnull Long fromTime) 544 throws PersistenceNotNullException { 545 checkForNull(fromTime); 546 547 boolean update = true; 548 549 if(this.fromTime != null) { 550 if(this.fromTime.equals(fromTime)) { 551 update = false; 552 } 553 } else if(fromTime == null) { 554 update = false; 555 } 556 557 if(update) { 558 this.fromTime = fromTime; 559 fromTimeHasBeenModified = true; 560 clearHashAndString(); 561 } 562 } 563 564 public boolean getFromTimeHasBeenModified() { 565 return fromTimeHasBeenModified; 566 } 567 568 @Nonnull 569 public Long getThruTime() { 570 return thruTime; 571 } 572 573 public void setThruTime(@Nonnull Long thruTime) 574 throws PersistenceNotNullException { 575 checkForNull(thruTime); 576 577 boolean update = true; 578 579 if(this.thruTime != null) { 580 if(this.thruTime.equals(thruTime)) { 581 update = false; 582 } 583 } else if(thruTime == null) { 584 update = false; 585 } 586 587 if(update) { 588 this.thruTime = thruTime; 589 thruTimeHasBeenModified = true; 590 clearHashAndString(); 591 } 592 } 593 594 public boolean getThruTimeHasBeenModified() { 595 return thruTimeHasBeenModified; 596 } 597 598}