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