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 * ItemHarmonizedTariffScheduleCodeDetailValue.java 021 */ 022 023package com.echothree.model.data.item.server.value; 024 025import com.echothree.model.data.item.common.pk.ItemHarmonizedTariffScheduleCodeDetailPK; 026 027import com.echothree.model.data.item.server.factory.ItemHarmonizedTariffScheduleCodeDetailFactory; 028 029import com.echothree.model.data.item.common.pk.ItemHarmonizedTariffScheduleCodePK; 030import com.echothree.model.data.item.common.pk.ItemPK; 031import com.echothree.model.data.geo.common.pk.GeoCodePK; 032import com.echothree.model.data.item.common.pk.HarmonizedTariffScheduleCodeUseTypePK; 033import com.echothree.model.data.item.common.pk.HarmonizedTariffScheduleCodePK; 034 035import com.echothree.util.common.exception.PersistenceCloneException; 036import com.echothree.util.common.exception.PersistenceNotNullException; 037 038import com.echothree.util.server.persistence.BaseValue; 039 040import java.io.Serializable; 041 042public class ItemHarmonizedTariffScheduleCodeDetailValue 043 extends BaseValue<ItemHarmonizedTariffScheduleCodeDetailPK> 044 implements Cloneable, Serializable { 045 046 private ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK; 047 private boolean itemHarmonizedTariffScheduleCodePKHasBeenModified = false; 048 private ItemPK itemPK; 049 private boolean itemPKHasBeenModified = false; 050 private GeoCodePK countryGeoCodePK; 051 private boolean countryGeoCodePKHasBeenModified = false; 052 private HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK; 053 private boolean harmonizedTariffScheduleCodeUseTypePKHasBeenModified = false; 054 private HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK; 055 private boolean harmonizedTariffScheduleCodePKHasBeenModified = 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(ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK, ItemPK itemPK, GeoCodePK countryGeoCodePK, HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK, HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK, Long fromTime, Long thruTime) 065 throws PersistenceNotNullException { 066 checkForNull(itemHarmonizedTariffScheduleCodePK); 067 this.itemHarmonizedTariffScheduleCodePK = itemHarmonizedTariffScheduleCodePK; 068 checkForNull(itemPK); 069 this.itemPK = itemPK; 070 checkForNull(countryGeoCodePK); 071 this.countryGeoCodePK = countryGeoCodePK; 072 checkForNull(harmonizedTariffScheduleCodeUseTypePK); 073 this.harmonizedTariffScheduleCodeUseTypePK = harmonizedTariffScheduleCodeUseTypePK; 074 checkForNull(harmonizedTariffScheduleCodePK); 075 this.harmonizedTariffScheduleCodePK = harmonizedTariffScheduleCodePK; 076 checkForNull(fromTime); 077 this.fromTime = fromTime; 078 checkForNull(thruTime); 079 this.thruTime = thruTime; 080 } 081 082 /** Creates a new instance of ItemHarmonizedTariffScheduleCodeDetailValue */ 083 public ItemHarmonizedTariffScheduleCodeDetailValue(ItemHarmonizedTariffScheduleCodeDetailPK itemHarmonizedTariffScheduleCodeDetailPK, ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK, ItemPK itemPK, GeoCodePK countryGeoCodePK, HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK, HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK, Long fromTime, Long thruTime) 084 throws PersistenceNotNullException { 085 super(itemHarmonizedTariffScheduleCodeDetailPK); 086 constructFields(itemHarmonizedTariffScheduleCodePK, itemPK, countryGeoCodePK, harmonizedTariffScheduleCodeUseTypePK, harmonizedTariffScheduleCodePK, fromTime, thruTime); 087 } 088 089 /** Creates a new instance of ItemHarmonizedTariffScheduleCodeDetailValue */ 090 public ItemHarmonizedTariffScheduleCodeDetailValue(ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK, ItemPK itemPK, GeoCodePK countryGeoCodePK, HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK, HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK, Long fromTime, Long thruTime) 091 throws PersistenceNotNullException { 092 super(); 093 constructFields(itemHarmonizedTariffScheduleCodePK, itemPK, countryGeoCodePK, harmonizedTariffScheduleCodeUseTypePK, harmonizedTariffScheduleCodePK, fromTime, thruTime); 094 } 095 096 @Override 097 public ItemHarmonizedTariffScheduleCodeDetailFactory getBaseFactoryInstance() { 098 return ItemHarmonizedTariffScheduleCodeDetailFactory.getInstance(); 099 } 100 101 @Override 102 public ItemHarmonizedTariffScheduleCodeDetailValue 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 (ItemHarmonizedTariffScheduleCodeDetailValue)result; 113 } 114 115 @Override 116 public ItemHarmonizedTariffScheduleCodeDetailPK getPrimaryKey() { 117 if(_primaryKey == null) { 118 _primaryKey = new ItemHarmonizedTariffScheduleCodeDetailPK(entityId); 119 } 120 121 return _primaryKey; 122 } 123 124 private void clearHashAndString() { 125 _hashCode = null; 126 _stringValue = null; 127 } 128 129 @Override 130 public int hashCode() { 131 if(_hashCode == null) { 132 int hashCode = 17; 133 134 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 135 136 hashCode = 37 * hashCode + ((itemHarmonizedTariffScheduleCodePK != null) ? itemHarmonizedTariffScheduleCodePK.hashCode() : 0); 137 hashCode = 37 * hashCode + ((itemPK != null) ? itemPK.hashCode() : 0); 138 hashCode = 37 * hashCode + ((countryGeoCodePK != null) ? countryGeoCodePK.hashCode() : 0); 139 hashCode = 37 * hashCode + ((harmonizedTariffScheduleCodeUseTypePK != null) ? harmonizedTariffScheduleCodeUseTypePK.hashCode() : 0); 140 hashCode = 37 * hashCode + ((harmonizedTariffScheduleCodePK != null) ? harmonizedTariffScheduleCodePK.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 public String toString() { 152 if(_stringValue == null) { 153 _stringValue = "{" + 154 "entityId=" + getEntityId() + 155 ", itemHarmonizedTariffScheduleCodePK=" + getItemHarmonizedTariffScheduleCodePK() + 156 ", itemPK=" + getItemPK() + 157 ", countryGeoCodePK=" + getCountryGeoCodePK() + 158 ", harmonizedTariffScheduleCodeUseTypePK=" + getHarmonizedTariffScheduleCodeUseTypePK() + 159 ", harmonizedTariffScheduleCodePK=" + getHarmonizedTariffScheduleCodePK() + 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 ItemHarmonizedTariffScheduleCodeDetailValue 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 ItemHarmonizedTariffScheduleCodeDetailValue that) { 194 boolean objectsEqual = true; 195 196 197 if(objectsEqual) { 198 ItemHarmonizedTariffScheduleCodePK thisItemHarmonizedTariffScheduleCodePK = getItemHarmonizedTariffScheduleCodePK(); 199 ItemHarmonizedTariffScheduleCodePK thatItemHarmonizedTariffScheduleCodePK = that.getItemHarmonizedTariffScheduleCodePK(); 200 201 if(thisItemHarmonizedTariffScheduleCodePK == null) { 202 objectsEqual = objectsEqual && (thatItemHarmonizedTariffScheduleCodePK == null); 203 } else { 204 objectsEqual = objectsEqual && thisItemHarmonizedTariffScheduleCodePK.equals(thatItemHarmonizedTariffScheduleCodePK); 205 } 206 } 207 208 if(objectsEqual) { 209 ItemPK thisItemPK = getItemPK(); 210 ItemPK thatItemPK = that.getItemPK(); 211 212 if(thisItemPK == null) { 213 objectsEqual = objectsEqual && (thatItemPK == null); 214 } else { 215 objectsEqual = objectsEqual && thisItemPK.equals(thatItemPK); 216 } 217 } 218 219 if(objectsEqual) { 220 GeoCodePK thisCountryGeoCodePK = getCountryGeoCodePK(); 221 GeoCodePK thatCountryGeoCodePK = that.getCountryGeoCodePK(); 222 223 if(thisCountryGeoCodePK == null) { 224 objectsEqual = objectsEqual && (thatCountryGeoCodePK == null); 225 } else { 226 objectsEqual = objectsEqual && thisCountryGeoCodePK.equals(thatCountryGeoCodePK); 227 } 228 } 229 230 if(objectsEqual) { 231 HarmonizedTariffScheduleCodeUseTypePK thisHarmonizedTariffScheduleCodeUseTypePK = getHarmonizedTariffScheduleCodeUseTypePK(); 232 HarmonizedTariffScheduleCodeUseTypePK thatHarmonizedTariffScheduleCodeUseTypePK = that.getHarmonizedTariffScheduleCodeUseTypePK(); 233 234 if(thisHarmonizedTariffScheduleCodeUseTypePK == null) { 235 objectsEqual = objectsEqual && (thatHarmonizedTariffScheduleCodeUseTypePK == null); 236 } else { 237 objectsEqual = objectsEqual && thisHarmonizedTariffScheduleCodeUseTypePK.equals(thatHarmonizedTariffScheduleCodeUseTypePK); 238 } 239 } 240 241 if(objectsEqual) { 242 HarmonizedTariffScheduleCodePK thisHarmonizedTariffScheduleCodePK = getHarmonizedTariffScheduleCodePK(); 243 HarmonizedTariffScheduleCodePK thatHarmonizedTariffScheduleCodePK = that.getHarmonizedTariffScheduleCodePK(); 244 245 if(thisHarmonizedTariffScheduleCodePK == null) { 246 objectsEqual = objectsEqual && (thatHarmonizedTariffScheduleCodePK == null); 247 } else { 248 objectsEqual = objectsEqual && thisHarmonizedTariffScheduleCodePK.equals(thatHarmonizedTariffScheduleCodePK); 249 } 250 } 251 252 if(objectsEqual) { 253 Long thisFromTime = getFromTime(); 254 Long thatFromTime = that.getFromTime(); 255 256 if(thisFromTime == null) { 257 objectsEqual = objectsEqual && (thatFromTime == null); 258 } else { 259 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 260 } 261 } 262 263 if(objectsEqual) { 264 Long thisThruTime = getThruTime(); 265 Long thatThruTime = that.getThruTime(); 266 267 if(thisThruTime == null) { 268 objectsEqual = objectsEqual && (thatThruTime == null); 269 } else { 270 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 271 } 272 } 273 274 return objectsEqual; 275 } else { 276 return false; 277 } 278 } 279 280 @Override 281 public boolean hasBeenModified() { 282 return itemHarmonizedTariffScheduleCodePKHasBeenModified || itemPKHasBeenModified || countryGeoCodePKHasBeenModified || harmonizedTariffScheduleCodeUseTypePKHasBeenModified || harmonizedTariffScheduleCodePKHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 283 } 284 285 @Override 286 public void clearHasBeenModified() { 287 itemHarmonizedTariffScheduleCodePKHasBeenModified = false; 288 itemPKHasBeenModified = false; 289 countryGeoCodePKHasBeenModified = false; 290 harmonizedTariffScheduleCodeUseTypePKHasBeenModified = false; 291 harmonizedTariffScheduleCodePKHasBeenModified = false; 292 fromTimeHasBeenModified = false; 293 thruTimeHasBeenModified = false; 294 } 295 296 public ItemHarmonizedTariffScheduleCodePK getItemHarmonizedTariffScheduleCodePK() { 297 return itemHarmonizedTariffScheduleCodePK; 298 } 299 300 public void setItemHarmonizedTariffScheduleCodePK(ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK) 301 throws PersistenceNotNullException { 302 checkForNull(itemHarmonizedTariffScheduleCodePK); 303 304 boolean update = true; 305 306 if(this.itemHarmonizedTariffScheduleCodePK != null) { 307 if(this.itemHarmonizedTariffScheduleCodePK.equals(itemHarmonizedTariffScheduleCodePK)) { 308 update = false; 309 } 310 } else if(itemHarmonizedTariffScheduleCodePK == null) { 311 update = false; 312 } 313 314 if(update) { 315 this.itemHarmonizedTariffScheduleCodePK = itemHarmonizedTariffScheduleCodePK; 316 itemHarmonizedTariffScheduleCodePKHasBeenModified = true; 317 clearHashAndString(); 318 } 319 } 320 321 public boolean getItemHarmonizedTariffScheduleCodePKHasBeenModified() { 322 return itemHarmonizedTariffScheduleCodePKHasBeenModified; 323 } 324 325 public ItemPK getItemPK() { 326 return itemPK; 327 } 328 329 public void setItemPK(ItemPK itemPK) 330 throws PersistenceNotNullException { 331 checkForNull(itemPK); 332 333 boolean update = true; 334 335 if(this.itemPK != null) { 336 if(this.itemPK.equals(itemPK)) { 337 update = false; 338 } 339 } else if(itemPK == null) { 340 update = false; 341 } 342 343 if(update) { 344 this.itemPK = itemPK; 345 itemPKHasBeenModified = true; 346 clearHashAndString(); 347 } 348 } 349 350 public boolean getItemPKHasBeenModified() { 351 return itemPKHasBeenModified; 352 } 353 354 public GeoCodePK getCountryGeoCodePK() { 355 return countryGeoCodePK; 356 } 357 358 public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK) 359 throws PersistenceNotNullException { 360 checkForNull(countryGeoCodePK); 361 362 boolean update = true; 363 364 if(this.countryGeoCodePK != null) { 365 if(this.countryGeoCodePK.equals(countryGeoCodePK)) { 366 update = false; 367 } 368 } else if(countryGeoCodePK == null) { 369 update = false; 370 } 371 372 if(update) { 373 this.countryGeoCodePK = countryGeoCodePK; 374 countryGeoCodePKHasBeenModified = true; 375 clearHashAndString(); 376 } 377 } 378 379 public boolean getCountryGeoCodePKHasBeenModified() { 380 return countryGeoCodePKHasBeenModified; 381 } 382 383 public HarmonizedTariffScheduleCodeUseTypePK getHarmonizedTariffScheduleCodeUseTypePK() { 384 return harmonizedTariffScheduleCodeUseTypePK; 385 } 386 387 public void setHarmonizedTariffScheduleCodeUseTypePK(HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK) 388 throws PersistenceNotNullException { 389 checkForNull(harmonizedTariffScheduleCodeUseTypePK); 390 391 boolean update = true; 392 393 if(this.harmonizedTariffScheduleCodeUseTypePK != null) { 394 if(this.harmonizedTariffScheduleCodeUseTypePK.equals(harmonizedTariffScheduleCodeUseTypePK)) { 395 update = false; 396 } 397 } else if(harmonizedTariffScheduleCodeUseTypePK == null) { 398 update = false; 399 } 400 401 if(update) { 402 this.harmonizedTariffScheduleCodeUseTypePK = harmonizedTariffScheduleCodeUseTypePK; 403 harmonizedTariffScheduleCodeUseTypePKHasBeenModified = true; 404 clearHashAndString(); 405 } 406 } 407 408 public boolean getHarmonizedTariffScheduleCodeUseTypePKHasBeenModified() { 409 return harmonizedTariffScheduleCodeUseTypePKHasBeenModified; 410 } 411 412 public HarmonizedTariffScheduleCodePK getHarmonizedTariffScheduleCodePK() { 413 return harmonizedTariffScheduleCodePK; 414 } 415 416 public void setHarmonizedTariffScheduleCodePK(HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK) 417 throws PersistenceNotNullException { 418 checkForNull(harmonizedTariffScheduleCodePK); 419 420 boolean update = true; 421 422 if(this.harmonizedTariffScheduleCodePK != null) { 423 if(this.harmonizedTariffScheduleCodePK.equals(harmonizedTariffScheduleCodePK)) { 424 update = false; 425 } 426 } else if(harmonizedTariffScheduleCodePK == null) { 427 update = false; 428 } 429 430 if(update) { 431 this.harmonizedTariffScheduleCodePK = harmonizedTariffScheduleCodePK; 432 harmonizedTariffScheduleCodePKHasBeenModified = true; 433 clearHashAndString(); 434 } 435 } 436 437 public boolean getHarmonizedTariffScheduleCodePKHasBeenModified() { 438 return harmonizedTariffScheduleCodePKHasBeenModified; 439 } 440 441 public Long getFromTime() { 442 return fromTime; 443 } 444 445 public void setFromTime(Long fromTime) 446 throws PersistenceNotNullException { 447 checkForNull(fromTime); 448 449 boolean update = true; 450 451 if(this.fromTime != null) { 452 if(this.fromTime.equals(fromTime)) { 453 update = false; 454 } 455 } else if(fromTime == null) { 456 update = false; 457 } 458 459 if(update) { 460 this.fromTime = fromTime; 461 fromTimeHasBeenModified = true; 462 clearHashAndString(); 463 } 464 } 465 466 public boolean getFromTimeHasBeenModified() { 467 return fromTimeHasBeenModified; 468 } 469 470 public Long getThruTime() { 471 return thruTime; 472 } 473 474 public void setThruTime(Long thruTime) 475 throws PersistenceNotNullException { 476 checkForNull(thruTime); 477 478 boolean update = true; 479 480 if(this.thruTime != null) { 481 if(this.thruTime.equals(thruTime)) { 482 update = false; 483 } 484 } else if(thruTime == null) { 485 update = false; 486 } 487 488 if(update) { 489 this.thruTime = thruTime; 490 thruTimeHasBeenModified = true; 491 clearHashAndString(); 492 } 493 } 494 495 public boolean getThruTimeHasBeenModified() { 496 return thruTimeHasBeenModified; 497 } 498 499}