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