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 * WorkRequirementScopeDetailValue.java 021 */ 022 023package com.echothree.model.data.workrequirement.server.value; 024 025import com.echothree.model.data.workrequirement.common.pk.WorkRequirementScopeDetailPK; 026 027import com.echothree.model.data.workrequirement.server.factory.WorkRequirementScopeDetailFactory; 028 029import com.echothree.model.data.workrequirement.common.pk.WorkRequirementScopePK; 030import com.echothree.model.data.workeffort.common.pk.WorkEffortScopePK; 031import com.echothree.model.data.workrequirement.common.pk.WorkRequirementTypePK; 032import com.echothree.model.data.sequence.common.pk.SequencePK; 033import com.echothree.model.data.selector.common.pk.SelectorPK; 034 035import com.echothree.util.common.exception.PersistenceCloneException; 036import com.echothree.util.common.exception.PersistenceNotNullException; 037 038import com.echothree.util.server.persistence.BaseValue; 039 040import java.io.Serializable; 041 042import javax.annotation.Nonnull; 043import javax.annotation.Nullable; 044 045public class WorkRequirementScopeDetailValue 046 extends BaseValue<WorkRequirementScopeDetailPK> 047 implements Cloneable, Serializable { 048 049 private WorkRequirementScopePK workRequirementScopePK; 050 private boolean workRequirementScopePKHasBeenModified = false; 051 private WorkEffortScopePK workEffortScopePK; 052 private boolean workEffortScopePKHasBeenModified = false; 053 private WorkRequirementTypePK workRequirementTypePK; 054 private boolean workRequirementTypePKHasBeenModified = false; 055 private SequencePK workRequirementSequencePK; 056 private boolean workRequirementSequencePKHasBeenModified = false; 057 private SequencePK workTimeSequencePK; 058 private boolean workTimeSequencePKHasBeenModified = false; 059 private SelectorPK workAssignmentSelectorPK; 060 private boolean workAssignmentSelectorPKHasBeenModified = false; 061 private Long estimatedTimeAllowed; 062 private boolean estimatedTimeAllowedHasBeenModified = false; 063 private Long maximumTimeAllowed; 064 private boolean maximumTimeAllowedHasBeenModified = false; 065 private Long fromTime; 066 private boolean fromTimeHasBeenModified = false; 067 private Long thruTime; 068 private boolean thruTimeHasBeenModified = false; 069 070 private transient Integer _hashCode = null; 071 private transient String _stringValue = null; 072 073 private void constructFields(WorkRequirementScopePK workRequirementScopePK, WorkEffortScopePK workEffortScopePK, WorkRequirementTypePK workRequirementTypePK, SequencePK workRequirementSequencePK, SequencePK workTimeSequencePK, SelectorPK workAssignmentSelectorPK, Long estimatedTimeAllowed, Long maximumTimeAllowed, Long fromTime, Long thruTime) 074 throws PersistenceNotNullException { 075 checkForNull(workRequirementScopePK); 076 this.workRequirementScopePK = workRequirementScopePK; 077 checkForNull(workEffortScopePK); 078 this.workEffortScopePK = workEffortScopePK; 079 checkForNull(workRequirementTypePK); 080 this.workRequirementTypePK = workRequirementTypePK; 081 this.workRequirementSequencePK = workRequirementSequencePK; 082 this.workTimeSequencePK = workTimeSequencePK; 083 this.workAssignmentSelectorPK = workAssignmentSelectorPK; 084 this.estimatedTimeAllowed = estimatedTimeAllowed; 085 this.maximumTimeAllowed = maximumTimeAllowed; 086 checkForNull(fromTime); 087 this.fromTime = fromTime; 088 checkForNull(thruTime); 089 this.thruTime = thruTime; 090 } 091 092 /** Creates a new instance of WorkRequirementScopeDetailValue */ 093 public WorkRequirementScopeDetailValue(WorkRequirementScopeDetailPK workRequirementScopeDetailPK, WorkRequirementScopePK workRequirementScopePK, WorkEffortScopePK workEffortScopePK, WorkRequirementTypePK workRequirementTypePK, SequencePK workRequirementSequencePK, SequencePK workTimeSequencePK, SelectorPK workAssignmentSelectorPK, Long estimatedTimeAllowed, Long maximumTimeAllowed, Long fromTime, Long thruTime) 094 throws PersistenceNotNullException { 095 super(workRequirementScopeDetailPK); 096 constructFields(workRequirementScopePK, workEffortScopePK, workRequirementTypePK, workRequirementSequencePK, workTimeSequencePK, workAssignmentSelectorPK, estimatedTimeAllowed, maximumTimeAllowed, fromTime, thruTime); 097 } 098 099 /** Creates a new instance of WorkRequirementScopeDetailValue */ 100 public WorkRequirementScopeDetailValue(WorkRequirementScopePK workRequirementScopePK, WorkEffortScopePK workEffortScopePK, WorkRequirementTypePK workRequirementTypePK, SequencePK workRequirementSequencePK, SequencePK workTimeSequencePK, SelectorPK workAssignmentSelectorPK, Long estimatedTimeAllowed, Long maximumTimeAllowed, Long fromTime, Long thruTime) 101 throws PersistenceNotNullException { 102 super(); 103 constructFields(workRequirementScopePK, workEffortScopePK, workRequirementTypePK, workRequirementSequencePK, workTimeSequencePK, workAssignmentSelectorPK, estimatedTimeAllowed, maximumTimeAllowed, fromTime, thruTime); 104 } 105 106 @Override 107 @Nonnull 108 public WorkRequirementScopeDetailFactory getBaseFactoryInstance() { 109 return WorkRequirementScopeDetailFactory.getInstance(); 110 } 111 112 @Override 113 @Nonnull 114 public WorkRequirementScopeDetailValue clone() { 115 Object result; 116 117 try { 118 result = super.clone(); 119 } catch (CloneNotSupportedException cnse) { 120 // This shouldn't happen, fail when it does. 121 throw new PersistenceCloneException(cnse); 122 } 123 124 return (WorkRequirementScopeDetailValue)result; 125 } 126 127 @Override 128 @Nonnull 129 public WorkRequirementScopeDetailPK getPrimaryKey() { 130 if(_primaryKey == null) { 131 _primaryKey = new WorkRequirementScopeDetailPK(entityId); 132 } 133 134 return _primaryKey; 135 } 136 137 private void clearHashAndString() { 138 _hashCode = null; 139 _stringValue = null; 140 } 141 142 @Override 143 public int hashCode() { 144 if(_hashCode == null) { 145 int hashCode = 17; 146 147 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 148 149 hashCode = 37 * hashCode + ((workRequirementScopePK != null) ? workRequirementScopePK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((workEffortScopePK != null) ? workEffortScopePK.hashCode() : 0); 151 hashCode = 37 * hashCode + ((workRequirementTypePK != null) ? workRequirementTypePK.hashCode() : 0); 152 hashCode = 37 * hashCode + ((workRequirementSequencePK != null) ? workRequirementSequencePK.hashCode() : 0); 153 hashCode = 37 * hashCode + ((workTimeSequencePK != null) ? workTimeSequencePK.hashCode() : 0); 154 hashCode = 37 * hashCode + ((workAssignmentSelectorPK != null) ? workAssignmentSelectorPK.hashCode() : 0); 155 hashCode = 37 * hashCode + ((estimatedTimeAllowed != null) ? estimatedTimeAllowed.hashCode() : 0); 156 hashCode = 37 * hashCode + ((maximumTimeAllowed != null) ? maximumTimeAllowed.hashCode() : 0); 157 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 158 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 159 160 _hashCode = hashCode; 161 } 162 163 return _hashCode; 164 } 165 166 @Override 167 @Nonnull 168 public String toString() { 169 if(_stringValue == null) { 170 _stringValue = "{" + 171 "entityId=" + getEntityId() + 172 ", workRequirementScopePK=" + getWorkRequirementScopePK() + 173 ", workEffortScopePK=" + getWorkEffortScopePK() + 174 ", workRequirementTypePK=" + getWorkRequirementTypePK() + 175 ", workRequirementSequencePK=" + getWorkRequirementSequencePK() + 176 ", workTimeSequencePK=" + getWorkTimeSequencePK() + 177 ", workAssignmentSelectorPK=" + getWorkAssignmentSelectorPK() + 178 ", estimatedTimeAllowed=" + getEstimatedTimeAllowed() + 179 ", maximumTimeAllowed=" + getMaximumTimeAllowed() + 180 ", fromTime=" + getFromTime() + 181 ", thruTime=" + getThruTime() + 182 "}"; 183 } 184 return _stringValue; 185 } 186 187 @Override 188 public boolean equals(Object other) { 189 if(this == other) 190 return true; 191 192 if(!hasIdentity()) 193 return false; 194 195 if(other instanceof WorkRequirementScopeDetailValue that) { 196 if(!that.hasIdentity()) 197 return false; 198 199 Long thisEntityId = getEntityId(); 200 Long thatEntityId = that.getEntityId(); 201 202 boolean objectsEqual = thisEntityId.equals(thatEntityId); 203 if(objectsEqual) 204 objectsEqual = isIdentical(that); 205 206 return objectsEqual; 207 } else { 208 return false; 209 } 210 } 211 212 public boolean isIdentical(Object other) { 213 if(other instanceof WorkRequirementScopeDetailValue that) { 214 boolean objectsEqual = true; 215 216 217 if(objectsEqual) { 218 WorkRequirementScopePK thisWorkRequirementScopePK = getWorkRequirementScopePK(); 219 WorkRequirementScopePK thatWorkRequirementScopePK = that.getWorkRequirementScopePK(); 220 221 if(thisWorkRequirementScopePK == null) { 222 objectsEqual = objectsEqual && (thatWorkRequirementScopePK == null); 223 } else { 224 objectsEqual = objectsEqual && thisWorkRequirementScopePK.equals(thatWorkRequirementScopePK); 225 } 226 } 227 228 if(objectsEqual) { 229 WorkEffortScopePK thisWorkEffortScopePK = getWorkEffortScopePK(); 230 WorkEffortScopePK thatWorkEffortScopePK = that.getWorkEffortScopePK(); 231 232 if(thisWorkEffortScopePK == null) { 233 objectsEqual = objectsEqual && (thatWorkEffortScopePK == null); 234 } else { 235 objectsEqual = objectsEqual && thisWorkEffortScopePK.equals(thatWorkEffortScopePK); 236 } 237 } 238 239 if(objectsEqual) { 240 WorkRequirementTypePK thisWorkRequirementTypePK = getWorkRequirementTypePK(); 241 WorkRequirementTypePK thatWorkRequirementTypePK = that.getWorkRequirementTypePK(); 242 243 if(thisWorkRequirementTypePK == null) { 244 objectsEqual = objectsEqual && (thatWorkRequirementTypePK == null); 245 } else { 246 objectsEqual = objectsEqual && thisWorkRequirementTypePK.equals(thatWorkRequirementTypePK); 247 } 248 } 249 250 if(objectsEqual) { 251 SequencePK thisWorkRequirementSequencePK = getWorkRequirementSequencePK(); 252 SequencePK thatWorkRequirementSequencePK = that.getWorkRequirementSequencePK(); 253 254 if(thisWorkRequirementSequencePK == null) { 255 objectsEqual = objectsEqual && (thatWorkRequirementSequencePK == null); 256 } else { 257 objectsEqual = objectsEqual && thisWorkRequirementSequencePK.equals(thatWorkRequirementSequencePK); 258 } 259 } 260 261 if(objectsEqual) { 262 SequencePK thisWorkTimeSequencePK = getWorkTimeSequencePK(); 263 SequencePK thatWorkTimeSequencePK = that.getWorkTimeSequencePK(); 264 265 if(thisWorkTimeSequencePK == null) { 266 objectsEqual = objectsEqual && (thatWorkTimeSequencePK == null); 267 } else { 268 objectsEqual = objectsEqual && thisWorkTimeSequencePK.equals(thatWorkTimeSequencePK); 269 } 270 } 271 272 if(objectsEqual) { 273 SelectorPK thisWorkAssignmentSelectorPK = getWorkAssignmentSelectorPK(); 274 SelectorPK thatWorkAssignmentSelectorPK = that.getWorkAssignmentSelectorPK(); 275 276 if(thisWorkAssignmentSelectorPK == null) { 277 objectsEqual = objectsEqual && (thatWorkAssignmentSelectorPK == null); 278 } else { 279 objectsEqual = objectsEqual && thisWorkAssignmentSelectorPK.equals(thatWorkAssignmentSelectorPK); 280 } 281 } 282 283 if(objectsEqual) { 284 Long thisEstimatedTimeAllowed = getEstimatedTimeAllowed(); 285 Long thatEstimatedTimeAllowed = that.getEstimatedTimeAllowed(); 286 287 if(thisEstimatedTimeAllowed == null) { 288 objectsEqual = objectsEqual && (thatEstimatedTimeAllowed == null); 289 } else { 290 objectsEqual = objectsEqual && thisEstimatedTimeAllowed.equals(thatEstimatedTimeAllowed); 291 } 292 } 293 294 if(objectsEqual) { 295 Long thisMaximumTimeAllowed = getMaximumTimeAllowed(); 296 Long thatMaximumTimeAllowed = that.getMaximumTimeAllowed(); 297 298 if(thisMaximumTimeAllowed == null) { 299 objectsEqual = objectsEqual && (thatMaximumTimeAllowed == null); 300 } else { 301 objectsEqual = objectsEqual && thisMaximumTimeAllowed.equals(thatMaximumTimeAllowed); 302 } 303 } 304 305 if(objectsEqual) { 306 Long thisFromTime = getFromTime(); 307 Long thatFromTime = that.getFromTime(); 308 309 if(thisFromTime == null) { 310 objectsEqual = objectsEqual && (thatFromTime == null); 311 } else { 312 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 313 } 314 } 315 316 if(objectsEqual) { 317 Long thisThruTime = getThruTime(); 318 Long thatThruTime = that.getThruTime(); 319 320 if(thisThruTime == null) { 321 objectsEqual = objectsEqual && (thatThruTime == null); 322 } else { 323 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 324 } 325 } 326 327 return objectsEqual; 328 } else { 329 return false; 330 } 331 } 332 333 @Override 334 public boolean hasBeenModified() { 335 return workRequirementScopePKHasBeenModified || workEffortScopePKHasBeenModified || workRequirementTypePKHasBeenModified || workRequirementSequencePKHasBeenModified || workTimeSequencePKHasBeenModified || workAssignmentSelectorPKHasBeenModified || estimatedTimeAllowedHasBeenModified || maximumTimeAllowedHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 336 } 337 338 @Override 339 public void clearHasBeenModified() { 340 workRequirementScopePKHasBeenModified = false; 341 workEffortScopePKHasBeenModified = false; 342 workRequirementTypePKHasBeenModified = false; 343 workRequirementSequencePKHasBeenModified = false; 344 workTimeSequencePKHasBeenModified = false; 345 workAssignmentSelectorPKHasBeenModified = false; 346 estimatedTimeAllowedHasBeenModified = false; 347 maximumTimeAllowedHasBeenModified = false; 348 fromTimeHasBeenModified = false; 349 thruTimeHasBeenModified = false; 350 } 351 352 @Nonnull 353 public WorkRequirementScopePK getWorkRequirementScopePK() { 354 return workRequirementScopePK; 355 } 356 357 public void setWorkRequirementScopePK(@Nonnull WorkRequirementScopePK workRequirementScopePK) 358 throws PersistenceNotNullException { 359 checkForNull(workRequirementScopePK); 360 361 boolean update = true; 362 363 if(this.workRequirementScopePK != null) { 364 if(this.workRequirementScopePK.equals(workRequirementScopePK)) { 365 update = false; 366 } 367 } else if(workRequirementScopePK == null) { 368 update = false; 369 } 370 371 if(update) { 372 this.workRequirementScopePK = workRequirementScopePK; 373 workRequirementScopePKHasBeenModified = true; 374 clearHashAndString(); 375 } 376 } 377 378 public boolean getWorkRequirementScopePKHasBeenModified() { 379 return workRequirementScopePKHasBeenModified; 380 } 381 382 @Nonnull 383 public WorkEffortScopePK getWorkEffortScopePK() { 384 return workEffortScopePK; 385 } 386 387 public void setWorkEffortScopePK(@Nonnull WorkEffortScopePK workEffortScopePK) 388 throws PersistenceNotNullException { 389 checkForNull(workEffortScopePK); 390 391 boolean update = true; 392 393 if(this.workEffortScopePK != null) { 394 if(this.workEffortScopePK.equals(workEffortScopePK)) { 395 update = false; 396 } 397 } else if(workEffortScopePK == null) { 398 update = false; 399 } 400 401 if(update) { 402 this.workEffortScopePK = workEffortScopePK; 403 workEffortScopePKHasBeenModified = true; 404 clearHashAndString(); 405 } 406 } 407 408 public boolean getWorkEffortScopePKHasBeenModified() { 409 return workEffortScopePKHasBeenModified; 410 } 411 412 @Nonnull 413 public WorkRequirementTypePK getWorkRequirementTypePK() { 414 return workRequirementTypePK; 415 } 416 417 public void setWorkRequirementTypePK(@Nonnull WorkRequirementTypePK workRequirementTypePK) 418 throws PersistenceNotNullException { 419 checkForNull(workRequirementTypePK); 420 421 boolean update = true; 422 423 if(this.workRequirementTypePK != null) { 424 if(this.workRequirementTypePK.equals(workRequirementTypePK)) { 425 update = false; 426 } 427 } else if(workRequirementTypePK == null) { 428 update = false; 429 } 430 431 if(update) { 432 this.workRequirementTypePK = workRequirementTypePK; 433 workRequirementTypePKHasBeenModified = true; 434 clearHashAndString(); 435 } 436 } 437 438 public boolean getWorkRequirementTypePKHasBeenModified() { 439 return workRequirementTypePKHasBeenModified; 440 } 441 442 @Nullable 443 public SequencePK getWorkRequirementSequencePK() { 444 return workRequirementSequencePK; 445 } 446 447 public void setWorkRequirementSequencePK(@Nullable SequencePK workRequirementSequencePK) { 448 boolean update = true; 449 450 if(this.workRequirementSequencePK != null) { 451 if(this.workRequirementSequencePK.equals(workRequirementSequencePK)) { 452 update = false; 453 } 454 } else if(workRequirementSequencePK == null) { 455 update = false; 456 } 457 458 if(update) { 459 this.workRequirementSequencePK = workRequirementSequencePK; 460 workRequirementSequencePKHasBeenModified = true; 461 clearHashAndString(); 462 } 463 } 464 465 public boolean getWorkRequirementSequencePKHasBeenModified() { 466 return workRequirementSequencePKHasBeenModified; 467 } 468 469 @Nullable 470 public SequencePK getWorkTimeSequencePK() { 471 return workTimeSequencePK; 472 } 473 474 public void setWorkTimeSequencePK(@Nullable SequencePK workTimeSequencePK) { 475 boolean update = true; 476 477 if(this.workTimeSequencePK != null) { 478 if(this.workTimeSequencePK.equals(workTimeSequencePK)) { 479 update = false; 480 } 481 } else if(workTimeSequencePK == null) { 482 update = false; 483 } 484 485 if(update) { 486 this.workTimeSequencePK = workTimeSequencePK; 487 workTimeSequencePKHasBeenModified = true; 488 clearHashAndString(); 489 } 490 } 491 492 public boolean getWorkTimeSequencePKHasBeenModified() { 493 return workTimeSequencePKHasBeenModified; 494 } 495 496 @Nullable 497 public SelectorPK getWorkAssignmentSelectorPK() { 498 return workAssignmentSelectorPK; 499 } 500 501 public void setWorkAssignmentSelectorPK(@Nullable SelectorPK workAssignmentSelectorPK) { 502 boolean update = true; 503 504 if(this.workAssignmentSelectorPK != null) { 505 if(this.workAssignmentSelectorPK.equals(workAssignmentSelectorPK)) { 506 update = false; 507 } 508 } else if(workAssignmentSelectorPK == null) { 509 update = false; 510 } 511 512 if(update) { 513 this.workAssignmentSelectorPK = workAssignmentSelectorPK; 514 workAssignmentSelectorPKHasBeenModified = true; 515 clearHashAndString(); 516 } 517 } 518 519 public boolean getWorkAssignmentSelectorPKHasBeenModified() { 520 return workAssignmentSelectorPKHasBeenModified; 521 } 522 523 @Nullable 524 public Long getEstimatedTimeAllowed() { 525 return estimatedTimeAllowed; 526 } 527 528 public void setEstimatedTimeAllowed(@Nullable Long estimatedTimeAllowed) { 529 boolean update = true; 530 531 if(this.estimatedTimeAllowed != null) { 532 if(this.estimatedTimeAllowed.equals(estimatedTimeAllowed)) { 533 update = false; 534 } 535 } else if(estimatedTimeAllowed == null) { 536 update = false; 537 } 538 539 if(update) { 540 this.estimatedTimeAllowed = estimatedTimeAllowed; 541 estimatedTimeAllowedHasBeenModified = true; 542 clearHashAndString(); 543 } 544 } 545 546 public boolean getEstimatedTimeAllowedHasBeenModified() { 547 return estimatedTimeAllowedHasBeenModified; 548 } 549 550 @Nullable 551 public Long getMaximumTimeAllowed() { 552 return maximumTimeAllowed; 553 } 554 555 public void setMaximumTimeAllowed(@Nullable Long maximumTimeAllowed) { 556 boolean update = true; 557 558 if(this.maximumTimeAllowed != null) { 559 if(this.maximumTimeAllowed.equals(maximumTimeAllowed)) { 560 update = false; 561 } 562 } else if(maximumTimeAllowed == null) { 563 update = false; 564 } 565 566 if(update) { 567 this.maximumTimeAllowed = maximumTimeAllowed; 568 maximumTimeAllowedHasBeenModified = true; 569 clearHashAndString(); 570 } 571 } 572 573 public boolean getMaximumTimeAllowedHasBeenModified() { 574 return maximumTimeAllowedHasBeenModified; 575 } 576 577 @Nonnull 578 public Long getFromTime() { 579 return fromTime; 580 } 581 582 public void setFromTime(@Nonnull Long fromTime) 583 throws PersistenceNotNullException { 584 checkForNull(fromTime); 585 586 boolean update = true; 587 588 if(this.fromTime != null) { 589 if(this.fromTime.equals(fromTime)) { 590 update = false; 591 } 592 } else if(fromTime == null) { 593 update = false; 594 } 595 596 if(update) { 597 this.fromTime = fromTime; 598 fromTimeHasBeenModified = true; 599 clearHashAndString(); 600 } 601 } 602 603 public boolean getFromTimeHasBeenModified() { 604 return fromTimeHasBeenModified; 605 } 606 607 @Nonnull 608 public Long getThruTime() { 609 return thruTime; 610 } 611 612 public void setThruTime(@Nonnull Long thruTime) 613 throws PersistenceNotNullException { 614 checkForNull(thruTime); 615 616 boolean update = true; 617 618 if(this.thruTime != null) { 619 if(this.thruTime.equals(thruTime)) { 620 update = false; 621 } 622 } else if(thruTime == null) { 623 update = false; 624 } 625 626 if(update) { 627 this.thruTime = thruTime; 628 thruTimeHasBeenModified = true; 629 clearHashAndString(); 630 } 631 } 632 633 public boolean getThruTimeHasBeenModified() { 634 return thruTimeHasBeenModified; 635 } 636 637}