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