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