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 * ChainActionChainActionSetValue.java 021 */ 022 023package com.echothree.model.data.chain.server.value; 024 025import com.echothree.model.data.chain.common.pk.ChainActionChainActionSetPK; 026 027import com.echothree.model.data.chain.server.factory.ChainActionChainActionSetFactory; 028 029import com.echothree.model.data.chain.common.pk.ChainActionPK; 030import com.echothree.model.data.chain.common.pk.ChainActionSetPK; 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 ChainActionChainActionSetValue 040 extends BaseValue<ChainActionChainActionSetPK> 041 implements Cloneable, Serializable { 042 043 private ChainActionPK chainActionPK; 044 private boolean chainActionPKHasBeenModified = false; 045 private ChainActionSetPK nextChainActionSetPK; 046 private boolean nextChainActionSetPKHasBeenModified = false; 047 private Long delayTime; 048 private boolean delayTimeHasBeenModified = false; 049 private Long fromTime; 050 private boolean fromTimeHasBeenModified = false; 051 private Long thruTime; 052 private boolean thruTimeHasBeenModified = false; 053 054 private transient Integer _hashCode = null; 055 private transient String _stringValue = null; 056 057 private void constructFields(ChainActionPK chainActionPK, ChainActionSetPK nextChainActionSetPK, Long delayTime, Long fromTime, Long thruTime) 058 throws PersistenceNotNullException { 059 checkForNull(chainActionPK); 060 this.chainActionPK = chainActionPK; 061 checkForNull(nextChainActionSetPK); 062 this.nextChainActionSetPK = nextChainActionSetPK; 063 checkForNull(delayTime); 064 this.delayTime = delayTime; 065 checkForNull(fromTime); 066 this.fromTime = fromTime; 067 checkForNull(thruTime); 068 this.thruTime = thruTime; 069 } 070 071 /** Creates a new instance of ChainActionChainActionSetValue */ 072 public ChainActionChainActionSetValue(ChainActionChainActionSetPK chainActionChainActionSetPK, ChainActionPK chainActionPK, ChainActionSetPK nextChainActionSetPK, Long delayTime, Long fromTime, Long thruTime) 073 throws PersistenceNotNullException { 074 super(chainActionChainActionSetPK); 075 constructFields(chainActionPK, nextChainActionSetPK, delayTime, fromTime, thruTime); 076 } 077 078 /** Creates a new instance of ChainActionChainActionSetValue */ 079 public ChainActionChainActionSetValue(ChainActionPK chainActionPK, ChainActionSetPK nextChainActionSetPK, Long delayTime, Long fromTime, Long thruTime) 080 throws PersistenceNotNullException { 081 super(); 082 constructFields(chainActionPK, nextChainActionSetPK, delayTime, fromTime, thruTime); 083 } 084 085 @Override 086 public ChainActionChainActionSetFactory getBaseFactoryInstance() { 087 return ChainActionChainActionSetFactory.getInstance(); 088 } 089 090 @Override 091 public ChainActionChainActionSetValue clone() { 092 Object result; 093 094 try { 095 result = super.clone(); 096 } catch (CloneNotSupportedException cnse) { 097 // This shouldn't happen, fail when it does. 098 throw new PersistenceCloneException(cnse); 099 } 100 101 return (ChainActionChainActionSetValue)result; 102 } 103 104 @Override 105 public ChainActionChainActionSetPK getPrimaryKey() { 106 if(_primaryKey == null) { 107 _primaryKey = new ChainActionChainActionSetPK(entityId); 108 } 109 110 return _primaryKey; 111 } 112 113 private void clearHashAndString() { 114 _hashCode = null; 115 _stringValue = null; 116 } 117 118 @Override 119 public int hashCode() { 120 if(_hashCode == null) { 121 int hashCode = 17; 122 123 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 124 125 hashCode = 37 * hashCode + ((chainActionPK != null) ? chainActionPK.hashCode() : 0); 126 hashCode = 37 * hashCode + ((nextChainActionSetPK != null) ? nextChainActionSetPK.hashCode() : 0); 127 hashCode = 37 * hashCode + ((delayTime != null) ? delayTime.hashCode() : 0); 128 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 129 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 130 131 _hashCode = hashCode; 132 } 133 134 return _hashCode; 135 } 136 137 @Override 138 public String toString() { 139 if(_stringValue == null) { 140 _stringValue = "{" + 141 "entityId=" + getEntityId() + 142 ", chainActionPK=" + getChainActionPK() + 143 ", nextChainActionSetPK=" + getNextChainActionSetPK() + 144 ", delayTime=" + getDelayTime() + 145 ", fromTime=" + getFromTime() + 146 ", thruTime=" + getThruTime() + 147 "}"; 148 } 149 return _stringValue; 150 } 151 152 @Override 153 public boolean equals(Object other) { 154 if(this == other) 155 return true; 156 157 if(!hasIdentity()) 158 return false; 159 160 if(other instanceof ChainActionChainActionSetValue that) { 161 if(!that.hasIdentity()) 162 return false; 163 164 Long thisEntityId = getEntityId(); 165 Long thatEntityId = that.getEntityId(); 166 167 boolean objectsEqual = thisEntityId.equals(thatEntityId); 168 if(objectsEqual) 169 objectsEqual = isIdentical(that); 170 171 return objectsEqual; 172 } else { 173 return false; 174 } 175 } 176 177 public boolean isIdentical(Object other) { 178 if(other instanceof ChainActionChainActionSetValue that) { 179 boolean objectsEqual = true; 180 181 182 if(objectsEqual) { 183 ChainActionPK thisChainActionPK = getChainActionPK(); 184 ChainActionPK thatChainActionPK = that.getChainActionPK(); 185 186 if(thisChainActionPK == null) { 187 objectsEqual = objectsEqual && (thatChainActionPK == null); 188 } else { 189 objectsEqual = objectsEqual && thisChainActionPK.equals(thatChainActionPK); 190 } 191 } 192 193 if(objectsEqual) { 194 ChainActionSetPK thisNextChainActionSetPK = getNextChainActionSetPK(); 195 ChainActionSetPK thatNextChainActionSetPK = that.getNextChainActionSetPK(); 196 197 if(thisNextChainActionSetPK == null) { 198 objectsEqual = objectsEqual && (thatNextChainActionSetPK == null); 199 } else { 200 objectsEqual = objectsEqual && thisNextChainActionSetPK.equals(thatNextChainActionSetPK); 201 } 202 } 203 204 if(objectsEqual) { 205 Long thisDelayTime = getDelayTime(); 206 Long thatDelayTime = that.getDelayTime(); 207 208 if(thisDelayTime == null) { 209 objectsEqual = objectsEqual && (thatDelayTime == null); 210 } else { 211 objectsEqual = objectsEqual && thisDelayTime.equals(thatDelayTime); 212 } 213 } 214 215 if(objectsEqual) { 216 Long thisFromTime = getFromTime(); 217 Long thatFromTime = that.getFromTime(); 218 219 if(thisFromTime == null) { 220 objectsEqual = objectsEqual && (thatFromTime == null); 221 } else { 222 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 223 } 224 } 225 226 if(objectsEqual) { 227 Long thisThruTime = getThruTime(); 228 Long thatThruTime = that.getThruTime(); 229 230 if(thisThruTime == null) { 231 objectsEqual = objectsEqual && (thatThruTime == null); 232 } else { 233 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 234 } 235 } 236 237 return objectsEqual; 238 } else { 239 return false; 240 } 241 } 242 243 @Override 244 public boolean hasBeenModified() { 245 return chainActionPKHasBeenModified || nextChainActionSetPKHasBeenModified || delayTimeHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 246 } 247 248 @Override 249 public void clearHasBeenModified() { 250 chainActionPKHasBeenModified = false; 251 nextChainActionSetPKHasBeenModified = false; 252 delayTimeHasBeenModified = false; 253 fromTimeHasBeenModified = false; 254 thruTimeHasBeenModified = false; 255 } 256 257 public ChainActionPK getChainActionPK() { 258 return chainActionPK; 259 } 260 261 public void setChainActionPK(ChainActionPK chainActionPK) 262 throws PersistenceNotNullException { 263 checkForNull(chainActionPK); 264 265 boolean update = true; 266 267 if(this.chainActionPK != null) { 268 if(this.chainActionPK.equals(chainActionPK)) { 269 update = false; 270 } 271 } else if(chainActionPK == null) { 272 update = false; 273 } 274 275 if(update) { 276 this.chainActionPK = chainActionPK; 277 chainActionPKHasBeenModified = true; 278 clearHashAndString(); 279 } 280 } 281 282 public boolean getChainActionPKHasBeenModified() { 283 return chainActionPKHasBeenModified; 284 } 285 286 public ChainActionSetPK getNextChainActionSetPK() { 287 return nextChainActionSetPK; 288 } 289 290 public void setNextChainActionSetPK(ChainActionSetPK nextChainActionSetPK) 291 throws PersistenceNotNullException { 292 checkForNull(nextChainActionSetPK); 293 294 boolean update = true; 295 296 if(this.nextChainActionSetPK != null) { 297 if(this.nextChainActionSetPK.equals(nextChainActionSetPK)) { 298 update = false; 299 } 300 } else if(nextChainActionSetPK == null) { 301 update = false; 302 } 303 304 if(update) { 305 this.nextChainActionSetPK = nextChainActionSetPK; 306 nextChainActionSetPKHasBeenModified = true; 307 clearHashAndString(); 308 } 309 } 310 311 public boolean getNextChainActionSetPKHasBeenModified() { 312 return nextChainActionSetPKHasBeenModified; 313 } 314 315 public Long getDelayTime() { 316 return delayTime; 317 } 318 319 public void setDelayTime(Long delayTime) 320 throws PersistenceNotNullException { 321 checkForNull(delayTime); 322 323 boolean update = true; 324 325 if(this.delayTime != null) { 326 if(this.delayTime.equals(delayTime)) { 327 update = false; 328 } 329 } else if(delayTime == null) { 330 update = false; 331 } 332 333 if(update) { 334 this.delayTime = delayTime; 335 delayTimeHasBeenModified = true; 336 clearHashAndString(); 337 } 338 } 339 340 public boolean getDelayTimeHasBeenModified() { 341 return delayTimeHasBeenModified; 342 } 343 344 public Long getFromTime() { 345 return fromTime; 346 } 347 348 public void setFromTime(Long fromTime) 349 throws PersistenceNotNullException { 350 checkForNull(fromTime); 351 352 boolean update = true; 353 354 if(this.fromTime != null) { 355 if(this.fromTime.equals(fromTime)) { 356 update = false; 357 } 358 } else if(fromTime == null) { 359 update = false; 360 } 361 362 if(update) { 363 this.fromTime = fromTime; 364 fromTimeHasBeenModified = true; 365 clearHashAndString(); 366 } 367 } 368 369 public boolean getFromTimeHasBeenModified() { 370 return fromTimeHasBeenModified; 371 } 372 373 public Long getThruTime() { 374 return thruTime; 375 } 376 377 public void setThruTime(Long thruTime) 378 throws PersistenceNotNullException { 379 checkForNull(thruTime); 380 381 boolean update = true; 382 383 if(this.thruTime != null) { 384 if(this.thruTime.equals(thruTime)) { 385 update = false; 386 } 387 } else if(thruTime == null) { 388 update = false; 389 } 390 391 if(update) { 392 this.thruTime = thruTime; 393 thruTimeHasBeenModified = true; 394 clearHashAndString(); 395 } 396 } 397 398 public boolean getThruTimeHasBeenModified() { 399 return thruTimeHasBeenModified; 400 } 401 402}