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