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 * LocationNameElementDetailValue.java 021 */ 022 023package com.echothree.model.data.warehouse.server.value; 024 025import com.echothree.model.data.warehouse.common.pk.LocationNameElementDetailPK; 026 027import com.echothree.model.data.warehouse.server.factory.LocationNameElementDetailFactory; 028 029import com.echothree.model.data.warehouse.common.pk.LocationNameElementPK; 030import com.echothree.model.data.warehouse.common.pk.LocationTypePK; 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 039import javax.annotation.Nonnull; 040import javax.annotation.Nullable; 041 042public class LocationNameElementDetailValue 043 extends BaseValue<LocationNameElementDetailPK> 044 implements Cloneable, Serializable { 045 046 private LocationNameElementPK locationNameElementPK; 047 private boolean locationNameElementPKHasBeenModified = false; 048 private LocationTypePK locationTypePK; 049 private boolean locationTypePKHasBeenModified = false; 050 private String locationNameElementName; 051 private boolean locationNameElementNameHasBeenModified = false; 052 private Integer offset; 053 private boolean offsetHasBeenModified = false; 054 private Integer length; 055 private boolean lengthHasBeenModified = false; 056 private String validationPattern; 057 private boolean validationPatternHasBeenModified = false; 058 private Long fromTime; 059 private boolean fromTimeHasBeenModified = false; 060 private Long thruTime; 061 private boolean thruTimeHasBeenModified = false; 062 063 private transient Integer _hashCode = null; 064 private transient String _stringValue = null; 065 066 private void constructFields(LocationNameElementPK locationNameElementPK, LocationTypePK locationTypePK, String locationNameElementName, Integer offset, Integer length, String validationPattern, Long fromTime, Long thruTime) 067 throws PersistenceNotNullException { 068 checkForNull(locationNameElementPK); 069 this.locationNameElementPK = locationNameElementPK; 070 checkForNull(locationTypePK); 071 this.locationTypePK = locationTypePK; 072 checkForNull(locationNameElementName); 073 this.locationNameElementName = locationNameElementName; 074 checkForNull(offset); 075 this.offset = offset; 076 checkForNull(length); 077 this.length = length; 078 this.validationPattern = validationPattern; 079 checkForNull(fromTime); 080 this.fromTime = fromTime; 081 checkForNull(thruTime); 082 this.thruTime = thruTime; 083 } 084 085 /** Creates a new instance of LocationNameElementDetailValue */ 086 public LocationNameElementDetailValue(LocationNameElementDetailPK locationNameElementDetailPK, LocationNameElementPK locationNameElementPK, LocationTypePK locationTypePK, String locationNameElementName, Integer offset, Integer length, String validationPattern, Long fromTime, Long thruTime) 087 throws PersistenceNotNullException { 088 super(locationNameElementDetailPK); 089 constructFields(locationNameElementPK, locationTypePK, locationNameElementName, offset, length, validationPattern, fromTime, thruTime); 090 } 091 092 /** Creates a new instance of LocationNameElementDetailValue */ 093 public LocationNameElementDetailValue(LocationNameElementPK locationNameElementPK, LocationTypePK locationTypePK, String locationNameElementName, Integer offset, Integer length, String validationPattern, Long fromTime, Long thruTime) 094 throws PersistenceNotNullException { 095 super(); 096 constructFields(locationNameElementPK, locationTypePK, locationNameElementName, offset, length, validationPattern, fromTime, thruTime); 097 } 098 099 @Override 100 @Nonnull 101 public LocationNameElementDetailFactory getBaseFactoryInstance() { 102 return LocationNameElementDetailFactory.getInstance(); 103 } 104 105 @Override 106 @Nonnull 107 public LocationNameElementDetailValue 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 (LocationNameElementDetailValue)result; 118 } 119 120 @Override 121 @Nonnull 122 public LocationNameElementDetailPK getPrimaryKey() { 123 if(_primaryKey == null) { 124 _primaryKey = new LocationNameElementDetailPK(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 + ((locationNameElementPK != null) ? locationNameElementPK.hashCode() : 0); 143 hashCode = 37 * hashCode + ((locationTypePK != null) ? locationTypePK.hashCode() : 0); 144 hashCode = 37 * hashCode + ((locationNameElementName != null) ? locationNameElementName.hashCode() : 0); 145 hashCode = 37 * hashCode + ((offset != null) ? offset.hashCode() : 0); 146 hashCode = 37 * hashCode + ((length != null) ? length.hashCode() : 0); 147 hashCode = 37 * hashCode + ((validationPattern != null) ? validationPattern.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 ", locationNameElementPK=" + getLocationNameElementPK() + 164 ", locationTypePK=" + getLocationTypePK() + 165 ", locationNameElementName=" + getLocationNameElementName() + 166 ", offset=" + getOffset() + 167 ", length=" + getLength() + 168 ", validationPattern=" + getValidationPattern() + 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 LocationNameElementDetailValue 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 LocationNameElementDetailValue that) { 203 boolean objectsEqual = true; 204 205 206 if(objectsEqual) { 207 LocationNameElementPK thisLocationNameElementPK = getLocationNameElementPK(); 208 LocationNameElementPK thatLocationNameElementPK = that.getLocationNameElementPK(); 209 210 if(thisLocationNameElementPK == null) { 211 objectsEqual = objectsEqual && (thatLocationNameElementPK == null); 212 } else { 213 objectsEqual = objectsEqual && thisLocationNameElementPK.equals(thatLocationNameElementPK); 214 } 215 } 216 217 if(objectsEqual) { 218 LocationTypePK thisLocationTypePK = getLocationTypePK(); 219 LocationTypePK thatLocationTypePK = that.getLocationTypePK(); 220 221 if(thisLocationTypePK == null) { 222 objectsEqual = objectsEqual && (thatLocationTypePK == null); 223 } else { 224 objectsEqual = objectsEqual && thisLocationTypePK.equals(thatLocationTypePK); 225 } 226 } 227 228 if(objectsEqual) { 229 String thisLocationNameElementName = getLocationNameElementName(); 230 String thatLocationNameElementName = that.getLocationNameElementName(); 231 232 if(thisLocationNameElementName == null) { 233 objectsEqual = objectsEqual && (thatLocationNameElementName == null); 234 } else { 235 objectsEqual = objectsEqual && thisLocationNameElementName.equals(thatLocationNameElementName); 236 } 237 } 238 239 if(objectsEqual) { 240 Integer thisOffset = getOffset(); 241 Integer thatOffset = that.getOffset(); 242 243 if(thisOffset == null) { 244 objectsEqual = objectsEqual && (thatOffset == null); 245 } else { 246 objectsEqual = objectsEqual && thisOffset.equals(thatOffset); 247 } 248 } 249 250 if(objectsEqual) { 251 Integer thisLength = getLength(); 252 Integer thatLength = that.getLength(); 253 254 if(thisLength == null) { 255 objectsEqual = objectsEqual && (thatLength == null); 256 } else { 257 objectsEqual = objectsEqual && thisLength.equals(thatLength); 258 } 259 } 260 261 if(objectsEqual) { 262 String thisValidationPattern = getValidationPattern(); 263 String thatValidationPattern = that.getValidationPattern(); 264 265 if(thisValidationPattern == null) { 266 objectsEqual = objectsEqual && (thatValidationPattern == null); 267 } else { 268 objectsEqual = objectsEqual && thisValidationPattern.equals(thatValidationPattern); 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 locationNameElementPKHasBeenModified || locationTypePKHasBeenModified || locationNameElementNameHasBeenModified || offsetHasBeenModified || lengthHasBeenModified || validationPatternHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 303 } 304 305 @Override 306 public void clearHasBeenModified() { 307 locationNameElementPKHasBeenModified = false; 308 locationTypePKHasBeenModified = false; 309 locationNameElementNameHasBeenModified = false; 310 offsetHasBeenModified = false; 311 lengthHasBeenModified = false; 312 validationPatternHasBeenModified = false; 313 fromTimeHasBeenModified = false; 314 thruTimeHasBeenModified = false; 315 } 316 317 @Nonnull 318 public LocationNameElementPK getLocationNameElementPK() { 319 return locationNameElementPK; 320 } 321 322 public void setLocationNameElementPK(@Nonnull LocationNameElementPK locationNameElementPK) 323 throws PersistenceNotNullException { 324 checkForNull(locationNameElementPK); 325 326 boolean update = true; 327 328 if(this.locationNameElementPK != null) { 329 if(this.locationNameElementPK.equals(locationNameElementPK)) { 330 update = false; 331 } 332 } else if(locationNameElementPK == null) { 333 update = false; 334 } 335 336 if(update) { 337 this.locationNameElementPK = locationNameElementPK; 338 locationNameElementPKHasBeenModified = true; 339 clearHashAndString(); 340 } 341 } 342 343 public boolean getLocationNameElementPKHasBeenModified() { 344 return locationNameElementPKHasBeenModified; 345 } 346 347 @Nonnull 348 public LocationTypePK getLocationTypePK() { 349 return locationTypePK; 350 } 351 352 public void setLocationTypePK(@Nonnull LocationTypePK locationTypePK) 353 throws PersistenceNotNullException { 354 checkForNull(locationTypePK); 355 356 boolean update = true; 357 358 if(this.locationTypePK != null) { 359 if(this.locationTypePK.equals(locationTypePK)) { 360 update = false; 361 } 362 } else if(locationTypePK == null) { 363 update = false; 364 } 365 366 if(update) { 367 this.locationTypePK = locationTypePK; 368 locationTypePKHasBeenModified = true; 369 clearHashAndString(); 370 } 371 } 372 373 public boolean getLocationTypePKHasBeenModified() { 374 return locationTypePKHasBeenModified; 375 } 376 377 @Nonnull 378 public String getLocationNameElementName() { 379 return locationNameElementName; 380 } 381 382 public void setLocationNameElementName(@Nonnull String locationNameElementName) 383 throws PersistenceNotNullException { 384 checkForNull(locationNameElementName); 385 386 boolean update = true; 387 388 if(this.locationNameElementName != null) { 389 if(this.locationNameElementName.equals(locationNameElementName)) { 390 update = false; 391 } 392 } else if(locationNameElementName == null) { 393 update = false; 394 } 395 396 if(update) { 397 this.locationNameElementName = locationNameElementName; 398 locationNameElementNameHasBeenModified = true; 399 clearHashAndString(); 400 } 401 } 402 403 public boolean getLocationNameElementNameHasBeenModified() { 404 return locationNameElementNameHasBeenModified; 405 } 406 407 @Nonnull 408 public Integer getOffset() { 409 return offset; 410 } 411 412 public void setOffset(@Nonnull Integer offset) 413 throws PersistenceNotNullException { 414 checkForNull(offset); 415 416 boolean update = true; 417 418 if(this.offset != null) { 419 if(this.offset.equals(offset)) { 420 update = false; 421 } 422 } else if(offset == null) { 423 update = false; 424 } 425 426 if(update) { 427 this.offset = offset; 428 offsetHasBeenModified = true; 429 clearHashAndString(); 430 } 431 } 432 433 public boolean getOffsetHasBeenModified() { 434 return offsetHasBeenModified; 435 } 436 437 @Nonnull 438 public Integer getLength() { 439 return length; 440 } 441 442 public void setLength(@Nonnull Integer length) 443 throws PersistenceNotNullException { 444 checkForNull(length); 445 446 boolean update = true; 447 448 if(this.length != null) { 449 if(this.length.equals(length)) { 450 update = false; 451 } 452 } else if(length == null) { 453 update = false; 454 } 455 456 if(update) { 457 this.length = length; 458 lengthHasBeenModified = true; 459 clearHashAndString(); 460 } 461 } 462 463 public boolean getLengthHasBeenModified() { 464 return lengthHasBeenModified; 465 } 466 467 @Nullable 468 public String getValidationPattern() { 469 return validationPattern; 470 } 471 472 public void setValidationPattern(@Nullable String validationPattern) { 473 boolean update = true; 474 475 if(this.validationPattern != null) { 476 if(this.validationPattern.equals(validationPattern)) { 477 update = false; 478 } 479 } else if(validationPattern == null) { 480 update = false; 481 } 482 483 if(update) { 484 this.validationPattern = validationPattern; 485 validationPatternHasBeenModified = true; 486 clearHashAndString(); 487 } 488 } 489 490 public boolean getValidationPatternHasBeenModified() { 491 return validationPatternHasBeenModified; 492 } 493 494 @Nonnull 495 public Long getFromTime() { 496 return fromTime; 497 } 498 499 public void setFromTime(@Nonnull Long fromTime) 500 throws PersistenceNotNullException { 501 checkForNull(fromTime); 502 503 boolean update = true; 504 505 if(this.fromTime != null) { 506 if(this.fromTime.equals(fromTime)) { 507 update = false; 508 } 509 } else if(fromTime == null) { 510 update = false; 511 } 512 513 if(update) { 514 this.fromTime = fromTime; 515 fromTimeHasBeenModified = true; 516 clearHashAndString(); 517 } 518 } 519 520 public boolean getFromTimeHasBeenModified() { 521 return fromTimeHasBeenModified; 522 } 523 524 @Nonnull 525 public Long getThruTime() { 526 return thruTime; 527 } 528 529 public void setThruTime(@Nonnull Long thruTime) 530 throws PersistenceNotNullException { 531 checkForNull(thruTime); 532 533 boolean update = true; 534 535 if(this.thruTime != null) { 536 if(this.thruTime.equals(thruTime)) { 537 update = false; 538 } 539 } else if(thruTime == null) { 540 update = false; 541 } 542 543 if(update) { 544 this.thruTime = thruTime; 545 thruTimeHasBeenModified = true; 546 clearHashAndString(); 547 } 548 } 549 550 public boolean getThruTimeHasBeenModified() { 551 return thruTimeHasBeenModified; 552 } 553 554}