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