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 * GlAccountCategoryDetailValue.java 021 */ 022 023package com.echothree.model.data.accounting.server.value; 024 025import com.echothree.model.data.accounting.common.pk.GlAccountCategoryDetailPK; 026 027import com.echothree.model.data.accounting.server.factory.GlAccountCategoryDetailFactory; 028 029import com.echothree.model.data.accounting.common.pk.GlAccountCategoryPK; 030 031import com.echothree.util.common.exception.PersistenceCloneException; 032import com.echothree.util.common.exception.PersistenceNotNullException; 033 034import com.echothree.util.server.persistence.BaseValue; 035 036import java.io.Serializable; 037 038public class GlAccountCategoryDetailValue 039 extends BaseValue<GlAccountCategoryDetailPK> 040 implements Cloneable, Serializable { 041 042 private GlAccountCategoryPK glAccountCategoryPK; 043 private boolean glAccountCategoryPKHasBeenModified = false; 044 private String glAccountCategoryName; 045 private boolean glAccountCategoryNameHasBeenModified = false; 046 private GlAccountCategoryPK parentGlAccountCategoryPK; 047 private boolean parentGlAccountCategoryPKHasBeenModified = false; 048 private Boolean isDefault; 049 private boolean isDefaultHasBeenModified = false; 050 private Integer sortOrder; 051 private boolean sortOrderHasBeenModified = false; 052 private Long fromTime; 053 private boolean fromTimeHasBeenModified = false; 054 private Long thruTime; 055 private boolean thruTimeHasBeenModified = false; 056 057 private transient Integer _hashCode = null; 058 private transient String _stringValue = null; 059 060 private void constructFields(GlAccountCategoryPK glAccountCategoryPK, String glAccountCategoryName, GlAccountCategoryPK parentGlAccountCategoryPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 061 throws PersistenceNotNullException { 062 checkForNull(glAccountCategoryPK); 063 this.glAccountCategoryPK = glAccountCategoryPK; 064 checkForNull(glAccountCategoryName); 065 this.glAccountCategoryName = glAccountCategoryName; 066 this.parentGlAccountCategoryPK = parentGlAccountCategoryPK; 067 checkForNull(isDefault); 068 this.isDefault = isDefault; 069 checkForNull(sortOrder); 070 this.sortOrder = sortOrder; 071 checkForNull(fromTime); 072 this.fromTime = fromTime; 073 checkForNull(thruTime); 074 this.thruTime = thruTime; 075 } 076 077 /** Creates a new instance of GlAccountCategoryDetailValue */ 078 public GlAccountCategoryDetailValue(GlAccountCategoryDetailPK glAccountCategoryDetailPK, GlAccountCategoryPK glAccountCategoryPK, String glAccountCategoryName, GlAccountCategoryPK parentGlAccountCategoryPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 079 throws PersistenceNotNullException { 080 super(glAccountCategoryDetailPK); 081 constructFields(glAccountCategoryPK, glAccountCategoryName, parentGlAccountCategoryPK, isDefault, sortOrder, fromTime, thruTime); 082 } 083 084 /** Creates a new instance of GlAccountCategoryDetailValue */ 085 public GlAccountCategoryDetailValue(GlAccountCategoryPK glAccountCategoryPK, String glAccountCategoryName, GlAccountCategoryPK parentGlAccountCategoryPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 086 throws PersistenceNotNullException { 087 super(); 088 constructFields(glAccountCategoryPK, glAccountCategoryName, parentGlAccountCategoryPK, isDefault, sortOrder, fromTime, thruTime); 089 } 090 091 @Override 092 public GlAccountCategoryDetailFactory getBaseFactoryInstance() { 093 return GlAccountCategoryDetailFactory.getInstance(); 094 } 095 096 @Override 097 public GlAccountCategoryDetailValue 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 (GlAccountCategoryDetailValue)result; 108 } 109 110 @Override 111 public GlAccountCategoryDetailPK getPrimaryKey() { 112 if(_primaryKey == null) { 113 _primaryKey = new GlAccountCategoryDetailPK(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 + ((glAccountCategoryPK != null) ? glAccountCategoryPK.hashCode() : 0); 132 hashCode = 37 * hashCode + ((glAccountCategoryName != null) ? glAccountCategoryName.hashCode() : 0); 133 hashCode = 37 * hashCode + ((parentGlAccountCategoryPK != null) ? parentGlAccountCategoryPK.hashCode() : 0); 134 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 135 hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.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 ", glAccountCategoryPK=" + getGlAccountCategoryPK() + 151 ", glAccountCategoryName=" + getGlAccountCategoryName() + 152 ", parentGlAccountCategoryPK=" + getParentGlAccountCategoryPK() + 153 ", isDefault=" + getIsDefault() + 154 ", sortOrder=" + getSortOrder() + 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 GlAccountCategoryDetailValue 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 GlAccountCategoryDetailValue that) { 189 boolean objectsEqual = true; 190 191 192 if(objectsEqual) { 193 GlAccountCategoryPK thisGlAccountCategoryPK = getGlAccountCategoryPK(); 194 GlAccountCategoryPK thatGlAccountCategoryPK = that.getGlAccountCategoryPK(); 195 196 if(thisGlAccountCategoryPK == null) { 197 objectsEqual = objectsEqual && (thatGlAccountCategoryPK == null); 198 } else { 199 objectsEqual = objectsEqual && thisGlAccountCategoryPK.equals(thatGlAccountCategoryPK); 200 } 201 } 202 203 if(objectsEqual) { 204 String thisGlAccountCategoryName = getGlAccountCategoryName(); 205 String thatGlAccountCategoryName = that.getGlAccountCategoryName(); 206 207 if(thisGlAccountCategoryName == null) { 208 objectsEqual = objectsEqual && (thatGlAccountCategoryName == null); 209 } else { 210 objectsEqual = objectsEqual && thisGlAccountCategoryName.equals(thatGlAccountCategoryName); 211 } 212 } 213 214 if(objectsEqual) { 215 GlAccountCategoryPK thisParentGlAccountCategoryPK = getParentGlAccountCategoryPK(); 216 GlAccountCategoryPK thatParentGlAccountCategoryPK = that.getParentGlAccountCategoryPK(); 217 218 if(thisParentGlAccountCategoryPK == null) { 219 objectsEqual = objectsEqual && (thatParentGlAccountCategoryPK == null); 220 } else { 221 objectsEqual = objectsEqual && thisParentGlAccountCategoryPK.equals(thatParentGlAccountCategoryPK); 222 } 223 } 224 225 if(objectsEqual) { 226 Boolean thisIsDefault = getIsDefault(); 227 Boolean thatIsDefault = that.getIsDefault(); 228 229 if(thisIsDefault == null) { 230 objectsEqual = objectsEqual && (thatIsDefault == null); 231 } else { 232 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 233 } 234 } 235 236 if(objectsEqual) { 237 Integer thisSortOrder = getSortOrder(); 238 Integer thatSortOrder = that.getSortOrder(); 239 240 if(thisSortOrder == null) { 241 objectsEqual = objectsEqual && (thatSortOrder == null); 242 } else { 243 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 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 glAccountCategoryPKHasBeenModified || glAccountCategoryNameHasBeenModified || parentGlAccountCategoryPKHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 278 } 279 280 @Override 281 public void clearHasBeenModified() { 282 glAccountCategoryPKHasBeenModified = false; 283 glAccountCategoryNameHasBeenModified = false; 284 parentGlAccountCategoryPKHasBeenModified = false; 285 isDefaultHasBeenModified = false; 286 sortOrderHasBeenModified = false; 287 fromTimeHasBeenModified = false; 288 thruTimeHasBeenModified = false; 289 } 290 291 public GlAccountCategoryPK getGlAccountCategoryPK() { 292 return glAccountCategoryPK; 293 } 294 295 public void setGlAccountCategoryPK(GlAccountCategoryPK glAccountCategoryPK) 296 throws PersistenceNotNullException { 297 checkForNull(glAccountCategoryPK); 298 299 boolean update = true; 300 301 if(this.glAccountCategoryPK != null) { 302 if(this.glAccountCategoryPK.equals(glAccountCategoryPK)) { 303 update = false; 304 } 305 } else if(glAccountCategoryPK == null) { 306 update = false; 307 } 308 309 if(update) { 310 this.glAccountCategoryPK = glAccountCategoryPK; 311 glAccountCategoryPKHasBeenModified = true; 312 clearHashAndString(); 313 } 314 } 315 316 public boolean getGlAccountCategoryPKHasBeenModified() { 317 return glAccountCategoryPKHasBeenModified; 318 } 319 320 public String getGlAccountCategoryName() { 321 return glAccountCategoryName; 322 } 323 324 public void setGlAccountCategoryName(String glAccountCategoryName) 325 throws PersistenceNotNullException { 326 checkForNull(glAccountCategoryName); 327 328 boolean update = true; 329 330 if(this.glAccountCategoryName != null) { 331 if(this.glAccountCategoryName.equals(glAccountCategoryName)) { 332 update = false; 333 } 334 } else if(glAccountCategoryName == null) { 335 update = false; 336 } 337 338 if(update) { 339 this.glAccountCategoryName = glAccountCategoryName; 340 glAccountCategoryNameHasBeenModified = true; 341 clearHashAndString(); 342 } 343 } 344 345 public boolean getGlAccountCategoryNameHasBeenModified() { 346 return glAccountCategoryNameHasBeenModified; 347 } 348 349 public GlAccountCategoryPK getParentGlAccountCategoryPK() { 350 return parentGlAccountCategoryPK; 351 } 352 353 public void setParentGlAccountCategoryPK(GlAccountCategoryPK parentGlAccountCategoryPK) { 354 boolean update = true; 355 356 if(this.parentGlAccountCategoryPK != null) { 357 if(this.parentGlAccountCategoryPK.equals(parentGlAccountCategoryPK)) { 358 update = false; 359 } 360 } else if(parentGlAccountCategoryPK == null) { 361 update = false; 362 } 363 364 if(update) { 365 this.parentGlAccountCategoryPK = parentGlAccountCategoryPK; 366 parentGlAccountCategoryPKHasBeenModified = true; 367 clearHashAndString(); 368 } 369 } 370 371 public boolean getParentGlAccountCategoryPKHasBeenModified() { 372 return parentGlAccountCategoryPKHasBeenModified; 373 } 374 375 public Boolean getIsDefault() { 376 return isDefault; 377 } 378 379 public void setIsDefault(Boolean isDefault) 380 throws PersistenceNotNullException { 381 checkForNull(isDefault); 382 383 boolean update = true; 384 385 if(this.isDefault != null) { 386 if(this.isDefault.equals(isDefault)) { 387 update = false; 388 } 389 } else if(isDefault == null) { 390 update = false; 391 } 392 393 if(update) { 394 this.isDefault = isDefault; 395 isDefaultHasBeenModified = true; 396 clearHashAndString(); 397 } 398 } 399 400 public boolean getIsDefaultHasBeenModified() { 401 return isDefaultHasBeenModified; 402 } 403 404 public Integer getSortOrder() { 405 return sortOrder; 406 } 407 408 public void setSortOrder(Integer sortOrder) 409 throws PersistenceNotNullException { 410 checkForNull(sortOrder); 411 412 boolean update = true; 413 414 if(this.sortOrder != null) { 415 if(this.sortOrder.equals(sortOrder)) { 416 update = false; 417 } 418 } else if(sortOrder == null) { 419 update = false; 420 } 421 422 if(update) { 423 this.sortOrder = sortOrder; 424 sortOrderHasBeenModified = true; 425 clearHashAndString(); 426 } 427 } 428 429 public boolean getSortOrderHasBeenModified() { 430 return sortOrderHasBeenModified; 431 } 432 433 public Long getFromTime() { 434 return fromTime; 435 } 436 437 public void setFromTime(Long fromTime) 438 throws PersistenceNotNullException { 439 checkForNull(fromTime); 440 441 boolean update = true; 442 443 if(this.fromTime != null) { 444 if(this.fromTime.equals(fromTime)) { 445 update = false; 446 } 447 } else if(fromTime == null) { 448 update = false; 449 } 450 451 if(update) { 452 this.fromTime = fromTime; 453 fromTimeHasBeenModified = true; 454 clearHashAndString(); 455 } 456 } 457 458 public boolean getFromTimeHasBeenModified() { 459 return fromTimeHasBeenModified; 460 } 461 462 public Long getThruTime() { 463 return thruTime; 464 } 465 466 public void setThruTime(Long thruTime) 467 throws PersistenceNotNullException { 468 checkForNull(thruTime); 469 470 boolean update = true; 471 472 if(this.thruTime != null) { 473 if(this.thruTime.equals(thruTime)) { 474 update = false; 475 } 476 } else if(thruTime == null) { 477 update = false; 478 } 479 480 if(update) { 481 this.thruTime = thruTime; 482 thruTimeHasBeenModified = true; 483 clearHashAndString(); 484 } 485 } 486 487 public boolean getThruTimeHasBeenModified() { 488 return thruTimeHasBeenModified; 489 } 490 491}