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