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 * PartyApplicationEditorUseDetailValue.java 021 */ 022 023package com.echothree.model.data.party.server.value; 024 025import com.echothree.model.data.party.common.pk.PartyApplicationEditorUseDetailPK; 026 027import com.echothree.model.data.party.server.factory.PartyApplicationEditorUseDetailFactory; 028 029import com.echothree.model.data.party.common.pk.PartyApplicationEditorUsePK; 030import com.echothree.model.data.party.common.pk.PartyPK; 031import com.echothree.model.data.core.common.pk.ApplicationEditorUsePK; 032import com.echothree.model.data.core.common.pk.ApplicationEditorPK; 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 PartyApplicationEditorUseDetailValue 045 extends BaseValue<PartyApplicationEditorUseDetailPK> 046 implements Cloneable, Serializable { 047 048 private PartyApplicationEditorUsePK partyApplicationEditorUsePK; 049 private boolean partyApplicationEditorUsePKHasBeenModified = false; 050 private PartyPK partyPK; 051 private boolean partyPKHasBeenModified = false; 052 private ApplicationEditorUsePK applicationEditorUsePK; 053 private boolean applicationEditorUsePKHasBeenModified = false; 054 private ApplicationEditorPK applicationEditorPK; 055 private boolean applicationEditorPKHasBeenModified = false; 056 private Integer preferredHeight; 057 private boolean preferredHeightHasBeenModified = false; 058 private Integer preferredWidth; 059 private boolean preferredWidthHasBeenModified = false; 060 private Long fromTime; 061 private boolean fromTimeHasBeenModified = false; 062 private Long thruTime; 063 private boolean thruTimeHasBeenModified = false; 064 065 private transient Integer _hashCode = null; 066 private transient String _stringValue = null; 067 068 private void constructFields(PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime) 069 throws PersistenceNotNullException { 070 checkForNull(partyApplicationEditorUsePK); 071 this.partyApplicationEditorUsePK = partyApplicationEditorUsePK; 072 checkForNull(partyPK); 073 this.partyPK = partyPK; 074 checkForNull(applicationEditorUsePK); 075 this.applicationEditorUsePK = applicationEditorUsePK; 076 this.applicationEditorPK = applicationEditorPK; 077 this.preferredHeight = preferredHeight; 078 this.preferredWidth = preferredWidth; 079 checkForNull(fromTime); 080 this.fromTime = fromTime; 081 checkForNull(thruTime); 082 this.thruTime = thruTime; 083 } 084 085 /** Creates a new instance of PartyApplicationEditorUseDetailValue */ 086 public PartyApplicationEditorUseDetailValue(PartyApplicationEditorUseDetailPK partyApplicationEditorUseDetailPK, PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime) 087 throws PersistenceNotNullException { 088 super(partyApplicationEditorUseDetailPK); 089 constructFields(partyApplicationEditorUsePK, partyPK, applicationEditorUsePK, applicationEditorPK, preferredHeight, preferredWidth, fromTime, thruTime); 090 } 091 092 /** Creates a new instance of PartyApplicationEditorUseDetailValue */ 093 public PartyApplicationEditorUseDetailValue(PartyApplicationEditorUsePK partyApplicationEditorUsePK, PartyPK partyPK, ApplicationEditorUsePK applicationEditorUsePK, ApplicationEditorPK applicationEditorPK, Integer preferredHeight, Integer preferredWidth, Long fromTime, Long thruTime) 094 throws PersistenceNotNullException { 095 super(); 096 constructFields(partyApplicationEditorUsePK, partyPK, applicationEditorUsePK, applicationEditorPK, preferredHeight, preferredWidth, fromTime, thruTime); 097 } 098 099 @Override 100 @Nonnull 101 public PartyApplicationEditorUseDetailFactory getBaseFactoryInstance() { 102 return PartyApplicationEditorUseDetailFactory.getInstance(); 103 } 104 105 @Override 106 @Nonnull 107 public PartyApplicationEditorUseDetailValue clone() { 108 Object result; 109 110 try { 111 result = super.clone(); 112 } catch (CloneNotSupportedException cnse) { 113 // This shouldn't happen, fail when it does. 114 throw new PersistenceCloneException(cnse); 115 } 116 117 return (PartyApplicationEditorUseDetailValue)result; 118 } 119 120 @Override 121 @Nonnull 122 public PartyApplicationEditorUseDetailPK getPrimaryKey() { 123 if(_primaryKey == null) { 124 _primaryKey = new PartyApplicationEditorUseDetailPK(entityId); 125 } 126 127 return _primaryKey; 128 } 129 130 private void clearHashAndString() { 131 _hashCode = null; 132 _stringValue = null; 133 } 134 135 @Override 136 public int hashCode() { 137 if(_hashCode == null) { 138 int hashCode = 17; 139 140 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 141 142 hashCode = 37 * hashCode + ((partyApplicationEditorUsePK != null) ? partyApplicationEditorUsePK.hashCode() : 0); 143 hashCode = 37 * hashCode + ((partyPK != null) ? partyPK.hashCode() : 0); 144 hashCode = 37 * hashCode + ((applicationEditorUsePK != null) ? applicationEditorUsePK.hashCode() : 0); 145 hashCode = 37 * hashCode + ((applicationEditorPK != null) ? applicationEditorPK.hashCode() : 0); 146 hashCode = 37 * hashCode + ((preferredHeight != null) ? preferredHeight.hashCode() : 0); 147 hashCode = 37 * hashCode + ((preferredWidth != null) ? preferredWidth.hashCode() : 0); 148 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 149 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 150 151 _hashCode = hashCode; 152 } 153 154 return _hashCode; 155 } 156 157 @Override 158 @Nonnull 159 public String toString() { 160 if(_stringValue == null) { 161 _stringValue = "{" + 162 "entityId=" + getEntityId() + 163 ", partyApplicationEditorUsePK=" + getPartyApplicationEditorUsePK() + 164 ", partyPK=" + getPartyPK() + 165 ", applicationEditorUsePK=" + getApplicationEditorUsePK() + 166 ", applicationEditorPK=" + getApplicationEditorPK() + 167 ", preferredHeight=" + getPreferredHeight() + 168 ", preferredWidth=" + getPreferredWidth() + 169 ", fromTime=" + getFromTime() + 170 ", thruTime=" + getThruTime() + 171 "}"; 172 } 173 return _stringValue; 174 } 175 176 @Override 177 public boolean equals(Object other) { 178 if(this == other) 179 return true; 180 181 if(!hasIdentity()) 182 return false; 183 184 if(other instanceof PartyApplicationEditorUseDetailValue that) { 185 if(!that.hasIdentity()) 186 return false; 187 188 Long thisEntityId = getEntityId(); 189 Long thatEntityId = that.getEntityId(); 190 191 boolean objectsEqual = thisEntityId.equals(thatEntityId); 192 if(objectsEqual) 193 objectsEqual = isIdentical(that); 194 195 return objectsEqual; 196 } else { 197 return false; 198 } 199 } 200 201 public boolean isIdentical(Object other) { 202 if(other instanceof PartyApplicationEditorUseDetailValue that) { 203 boolean objectsEqual = true; 204 205 206 if(objectsEqual) { 207 PartyApplicationEditorUsePK thisPartyApplicationEditorUsePK = getPartyApplicationEditorUsePK(); 208 PartyApplicationEditorUsePK thatPartyApplicationEditorUsePK = that.getPartyApplicationEditorUsePK(); 209 210 if(thisPartyApplicationEditorUsePK == null) { 211 objectsEqual = objectsEqual && (thatPartyApplicationEditorUsePK == null); 212 } else { 213 objectsEqual = objectsEqual && thisPartyApplicationEditorUsePK.equals(thatPartyApplicationEditorUsePK); 214 } 215 } 216 217 if(objectsEqual) { 218 PartyPK thisPartyPK = getPartyPK(); 219 PartyPK thatPartyPK = that.getPartyPK(); 220 221 if(thisPartyPK == null) { 222 objectsEqual = objectsEqual && (thatPartyPK == null); 223 } else { 224 objectsEqual = objectsEqual && thisPartyPK.equals(thatPartyPK); 225 } 226 } 227 228 if(objectsEqual) { 229 ApplicationEditorUsePK thisApplicationEditorUsePK = getApplicationEditorUsePK(); 230 ApplicationEditorUsePK thatApplicationEditorUsePK = that.getApplicationEditorUsePK(); 231 232 if(thisApplicationEditorUsePK == null) { 233 objectsEqual = objectsEqual && (thatApplicationEditorUsePK == null); 234 } else { 235 objectsEqual = objectsEqual && thisApplicationEditorUsePK.equals(thatApplicationEditorUsePK); 236 } 237 } 238 239 if(objectsEqual) { 240 ApplicationEditorPK thisApplicationEditorPK = getApplicationEditorPK(); 241 ApplicationEditorPK thatApplicationEditorPK = that.getApplicationEditorPK(); 242 243 if(thisApplicationEditorPK == null) { 244 objectsEqual = objectsEqual && (thatApplicationEditorPK == null); 245 } else { 246 objectsEqual = objectsEqual && thisApplicationEditorPK.equals(thatApplicationEditorPK); 247 } 248 } 249 250 if(objectsEqual) { 251 Integer thisPreferredHeight = getPreferredHeight(); 252 Integer thatPreferredHeight = that.getPreferredHeight(); 253 254 if(thisPreferredHeight == null) { 255 objectsEqual = objectsEqual && (thatPreferredHeight == null); 256 } else { 257 objectsEqual = objectsEqual && thisPreferredHeight.equals(thatPreferredHeight); 258 } 259 } 260 261 if(objectsEqual) { 262 Integer thisPreferredWidth = getPreferredWidth(); 263 Integer thatPreferredWidth = that.getPreferredWidth(); 264 265 if(thisPreferredWidth == null) { 266 objectsEqual = objectsEqual && (thatPreferredWidth == null); 267 } else { 268 objectsEqual = objectsEqual && thisPreferredWidth.equals(thatPreferredWidth); 269 } 270 } 271 272 if(objectsEqual) { 273 Long thisFromTime = getFromTime(); 274 Long thatFromTime = that.getFromTime(); 275 276 if(thisFromTime == null) { 277 objectsEqual = objectsEqual && (thatFromTime == null); 278 } else { 279 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 280 } 281 } 282 283 if(objectsEqual) { 284 Long thisThruTime = getThruTime(); 285 Long thatThruTime = that.getThruTime(); 286 287 if(thisThruTime == null) { 288 objectsEqual = objectsEqual && (thatThruTime == null); 289 } else { 290 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 291 } 292 } 293 294 return objectsEqual; 295 } else { 296 return false; 297 } 298 } 299 300 @Override 301 public boolean hasBeenModified() { 302 return partyApplicationEditorUsePKHasBeenModified || partyPKHasBeenModified || applicationEditorUsePKHasBeenModified || applicationEditorPKHasBeenModified || preferredHeightHasBeenModified || preferredWidthHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 303 } 304 305 @Override 306 public void clearHasBeenModified() { 307 partyApplicationEditorUsePKHasBeenModified = false; 308 partyPKHasBeenModified = false; 309 applicationEditorUsePKHasBeenModified = false; 310 applicationEditorPKHasBeenModified = false; 311 preferredHeightHasBeenModified = false; 312 preferredWidthHasBeenModified = false; 313 fromTimeHasBeenModified = false; 314 thruTimeHasBeenModified = false; 315 } 316 317 @Nonnull 318 public PartyApplicationEditorUsePK getPartyApplicationEditorUsePK() { 319 return partyApplicationEditorUsePK; 320 } 321 322 public void setPartyApplicationEditorUsePK(@Nonnull PartyApplicationEditorUsePK partyApplicationEditorUsePK) 323 throws PersistenceNotNullException { 324 checkForNull(partyApplicationEditorUsePK); 325 326 boolean update = true; 327 328 if(this.partyApplicationEditorUsePK != null) { 329 if(this.partyApplicationEditorUsePK.equals(partyApplicationEditorUsePK)) { 330 update = false; 331 } 332 } else if(partyApplicationEditorUsePK == null) { 333 update = false; 334 } 335 336 if(update) { 337 this.partyApplicationEditorUsePK = partyApplicationEditorUsePK; 338 partyApplicationEditorUsePKHasBeenModified = true; 339 clearHashAndString(); 340 } 341 } 342 343 public boolean getPartyApplicationEditorUsePKHasBeenModified() { 344 return partyApplicationEditorUsePKHasBeenModified; 345 } 346 347 @Nonnull 348 public PartyPK getPartyPK() { 349 return partyPK; 350 } 351 352 public void setPartyPK(@Nonnull PartyPK partyPK) 353 throws PersistenceNotNullException { 354 checkForNull(partyPK); 355 356 boolean update = true; 357 358 if(this.partyPK != null) { 359 if(this.partyPK.equals(partyPK)) { 360 update = false; 361 } 362 } else if(partyPK == null) { 363 update = false; 364 } 365 366 if(update) { 367 this.partyPK = partyPK; 368 partyPKHasBeenModified = true; 369 clearHashAndString(); 370 } 371 } 372 373 public boolean getPartyPKHasBeenModified() { 374 return partyPKHasBeenModified; 375 } 376 377 @Nonnull 378 public ApplicationEditorUsePK getApplicationEditorUsePK() { 379 return applicationEditorUsePK; 380 } 381 382 public void setApplicationEditorUsePK(@Nonnull ApplicationEditorUsePK applicationEditorUsePK) 383 throws PersistenceNotNullException { 384 checkForNull(applicationEditorUsePK); 385 386 boolean update = true; 387 388 if(this.applicationEditorUsePK != null) { 389 if(this.applicationEditorUsePK.equals(applicationEditorUsePK)) { 390 update = false; 391 } 392 } else if(applicationEditorUsePK == null) { 393 update = false; 394 } 395 396 if(update) { 397 this.applicationEditorUsePK = applicationEditorUsePK; 398 applicationEditorUsePKHasBeenModified = true; 399 clearHashAndString(); 400 } 401 } 402 403 public boolean getApplicationEditorUsePKHasBeenModified() { 404 return applicationEditorUsePKHasBeenModified; 405 } 406 407 @Nullable 408 public ApplicationEditorPK getApplicationEditorPK() { 409 return applicationEditorPK; 410 } 411 412 public void setApplicationEditorPK(@Nullable ApplicationEditorPK applicationEditorPK) { 413 boolean update = true; 414 415 if(this.applicationEditorPK != null) { 416 if(this.applicationEditorPK.equals(applicationEditorPK)) { 417 update = false; 418 } 419 } else if(applicationEditorPK == null) { 420 update = false; 421 } 422 423 if(update) { 424 this.applicationEditorPK = applicationEditorPK; 425 applicationEditorPKHasBeenModified = true; 426 clearHashAndString(); 427 } 428 } 429 430 public boolean getApplicationEditorPKHasBeenModified() { 431 return applicationEditorPKHasBeenModified; 432 } 433 434 @Nullable 435 public Integer getPreferredHeight() { 436 return preferredHeight; 437 } 438 439 public void setPreferredHeight(@Nullable Integer preferredHeight) { 440 boolean update = true; 441 442 if(this.preferredHeight != null) { 443 if(this.preferredHeight.equals(preferredHeight)) { 444 update = false; 445 } 446 } else if(preferredHeight == null) { 447 update = false; 448 } 449 450 if(update) { 451 this.preferredHeight = preferredHeight; 452 preferredHeightHasBeenModified = true; 453 clearHashAndString(); 454 } 455 } 456 457 public boolean getPreferredHeightHasBeenModified() { 458 return preferredHeightHasBeenModified; 459 } 460 461 @Nullable 462 public Integer getPreferredWidth() { 463 return preferredWidth; 464 } 465 466 public void setPreferredWidth(@Nullable Integer preferredWidth) { 467 boolean update = true; 468 469 if(this.preferredWidth != null) { 470 if(this.preferredWidth.equals(preferredWidth)) { 471 update = false; 472 } 473 } else if(preferredWidth == null) { 474 update = false; 475 } 476 477 if(update) { 478 this.preferredWidth = preferredWidth; 479 preferredWidthHasBeenModified = true; 480 clearHashAndString(); 481 } 482 } 483 484 public boolean getPreferredWidthHasBeenModified() { 485 return preferredWidthHasBeenModified; 486 } 487 488 @Nonnull 489 public Long getFromTime() { 490 return fromTime; 491 } 492 493 public void setFromTime(@Nonnull Long fromTime) 494 throws PersistenceNotNullException { 495 checkForNull(fromTime); 496 497 boolean update = true; 498 499 if(this.fromTime != null) { 500 if(this.fromTime.equals(fromTime)) { 501 update = false; 502 } 503 } else if(fromTime == null) { 504 update = false; 505 } 506 507 if(update) { 508 this.fromTime = fromTime; 509 fromTimeHasBeenModified = true; 510 clearHashAndString(); 511 } 512 } 513 514 public boolean getFromTimeHasBeenModified() { 515 return fromTimeHasBeenModified; 516 } 517 518 @Nonnull 519 public Long getThruTime() { 520 return thruTime; 521 } 522 523 public void setThruTime(@Nonnull 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}