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