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 * CarrierServiceDetailValue.java 021 */ 022 023package com.echothree.model.data.carrier.server.value; 024 025import com.echothree.model.data.carrier.common.pk.CarrierServiceDetailPK; 026 027import com.echothree.model.data.carrier.server.factory.CarrierServiceDetailFactory; 028 029import com.echothree.model.data.carrier.common.pk.CarrierServicePK; 030import com.echothree.model.data.party.common.pk.PartyPK; 031import com.echothree.model.data.selector.common.pk.SelectorPK; 032 033import com.echothree.util.common.exception.PersistenceCloneException; 034import com.echothree.util.common.exception.PersistenceNotNullException; 035 036import com.echothree.util.server.persistence.BaseValue; 037 038import java.io.Serializable; 039 040public class CarrierServiceDetailValue 041 extends BaseValue<CarrierServiceDetailPK> 042 implements Cloneable, Serializable { 043 044 private CarrierServicePK carrierServicePK; 045 private boolean carrierServicePKHasBeenModified = false; 046 private PartyPK carrierPartyPK; 047 private boolean carrierPartyPKHasBeenModified = false; 048 private String carrierServiceName; 049 private boolean carrierServiceNameHasBeenModified = false; 050 private SelectorPK geoCodeSelectorPK; 051 private boolean geoCodeSelectorPKHasBeenModified = false; 052 private SelectorPK itemSelectorPK; 053 private boolean itemSelectorPKHasBeenModified = false; 054 private Boolean isDefault; 055 private boolean isDefaultHasBeenModified = false; 056 private Integer sortOrder; 057 private boolean sortOrderHasBeenModified = 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(CarrierServicePK carrierServicePK, PartyPK carrierPartyPK, String carrierServiceName, SelectorPK geoCodeSelectorPK, SelectorPK itemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 067 throws PersistenceNotNullException { 068 checkForNull(carrierServicePK); 069 this.carrierServicePK = carrierServicePK; 070 checkForNull(carrierPartyPK); 071 this.carrierPartyPK = carrierPartyPK; 072 checkForNull(carrierServiceName); 073 this.carrierServiceName = carrierServiceName; 074 this.geoCodeSelectorPK = geoCodeSelectorPK; 075 this.itemSelectorPK = itemSelectorPK; 076 checkForNull(isDefault); 077 this.isDefault = isDefault; 078 checkForNull(sortOrder); 079 this.sortOrder = sortOrder; 080 checkForNull(fromTime); 081 this.fromTime = fromTime; 082 checkForNull(thruTime); 083 this.thruTime = thruTime; 084 } 085 086 /** Creates a new instance of CarrierServiceDetailValue */ 087 public CarrierServiceDetailValue(CarrierServiceDetailPK carrierServiceDetailPK, CarrierServicePK carrierServicePK, PartyPK carrierPartyPK, String carrierServiceName, SelectorPK geoCodeSelectorPK, SelectorPK itemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 088 throws PersistenceNotNullException { 089 super(carrierServiceDetailPK); 090 constructFields(carrierServicePK, carrierPartyPK, carrierServiceName, geoCodeSelectorPK, itemSelectorPK, isDefault, sortOrder, fromTime, thruTime); 091 } 092 093 /** Creates a new instance of CarrierServiceDetailValue */ 094 public CarrierServiceDetailValue(CarrierServicePK carrierServicePK, PartyPK carrierPartyPK, String carrierServiceName, SelectorPK geoCodeSelectorPK, SelectorPK itemSelectorPK, Boolean isDefault, Integer sortOrder, Long fromTime, Long thruTime) 095 throws PersistenceNotNullException { 096 super(); 097 constructFields(carrierServicePK, carrierPartyPK, carrierServiceName, geoCodeSelectorPK, itemSelectorPK, isDefault, sortOrder, fromTime, thruTime); 098 } 099 100 @Override 101 public CarrierServiceDetailFactory getBaseFactoryInstance() { 102 return CarrierServiceDetailFactory.getInstance(); 103 } 104 105 @Override 106 public CarrierServiceDetailValue clone() { 107 Object result; 108 109 try { 110 result = super.clone(); 111 } catch (CloneNotSupportedException cnse) { 112 // This shouldn't happen, fail when it does. 113 throw new PersistenceCloneException(cnse); 114 } 115 116 return (CarrierServiceDetailValue)result; 117 } 118 119 @Override 120 public CarrierServiceDetailPK getPrimaryKey() { 121 if(_primaryKey == null) { 122 _primaryKey = new CarrierServiceDetailPK(entityId); 123 } 124 125 return _primaryKey; 126 } 127 128 private void clearHashAndString() { 129 _hashCode = null; 130 _stringValue = null; 131 } 132 133 @Override 134 public int hashCode() { 135 if(_hashCode == null) { 136 int hashCode = 17; 137 138 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 139 140 hashCode = 37 * hashCode + ((carrierServicePK != null) ? carrierServicePK.hashCode() : 0); 141 hashCode = 37 * hashCode + ((carrierPartyPK != null) ? carrierPartyPK.hashCode() : 0); 142 hashCode = 37 * hashCode + ((carrierServiceName != null) ? carrierServiceName.hashCode() : 0); 143 hashCode = 37 * hashCode + ((geoCodeSelectorPK != null) ? geoCodeSelectorPK.hashCode() : 0); 144 hashCode = 37 * hashCode + ((itemSelectorPK != null) ? itemSelectorPK.hashCode() : 0); 145 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 146 hashCode = 37 * hashCode + ((sortOrder != null) ? sortOrder.hashCode() : 0); 147 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 148 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 149 150 _hashCode = hashCode; 151 } 152 153 return _hashCode; 154 } 155 156 @Override 157 public String toString() { 158 if(_stringValue == null) { 159 _stringValue = "{" + 160 "entityId=" + getEntityId() + 161 ", carrierServicePK=" + getCarrierServicePK() + 162 ", carrierPartyPK=" + getCarrierPartyPK() + 163 ", carrierServiceName=" + getCarrierServiceName() + 164 ", geoCodeSelectorPK=" + getGeoCodeSelectorPK() + 165 ", itemSelectorPK=" + getItemSelectorPK() + 166 ", isDefault=" + getIsDefault() + 167 ", sortOrder=" + getSortOrder() + 168 ", fromTime=" + getFromTime() + 169 ", thruTime=" + getThruTime() + 170 "}"; 171 } 172 return _stringValue; 173 } 174 175 @Override 176 public boolean equals(Object other) { 177 if(this == other) 178 return true; 179 180 if(!hasIdentity()) 181 return false; 182 183 if(other instanceof CarrierServiceDetailValue that) { 184 if(!that.hasIdentity()) 185 return false; 186 187 Long thisEntityId = getEntityId(); 188 Long thatEntityId = that.getEntityId(); 189 190 boolean objectsEqual = thisEntityId.equals(thatEntityId); 191 if(objectsEqual) 192 objectsEqual = isIdentical(that); 193 194 return objectsEqual; 195 } else { 196 return false; 197 } 198 } 199 200 public boolean isIdentical(Object other) { 201 if(other instanceof CarrierServiceDetailValue that) { 202 boolean objectsEqual = true; 203 204 205 if(objectsEqual) { 206 CarrierServicePK thisCarrierServicePK = getCarrierServicePK(); 207 CarrierServicePK thatCarrierServicePK = that.getCarrierServicePK(); 208 209 if(thisCarrierServicePK == null) { 210 objectsEqual = objectsEqual && (thatCarrierServicePK == null); 211 } else { 212 objectsEqual = objectsEqual && thisCarrierServicePK.equals(thatCarrierServicePK); 213 } 214 } 215 216 if(objectsEqual) { 217 PartyPK thisCarrierPartyPK = getCarrierPartyPK(); 218 PartyPK thatCarrierPartyPK = that.getCarrierPartyPK(); 219 220 if(thisCarrierPartyPK == null) { 221 objectsEqual = objectsEqual && (thatCarrierPartyPK == null); 222 } else { 223 objectsEqual = objectsEqual && thisCarrierPartyPK.equals(thatCarrierPartyPK); 224 } 225 } 226 227 if(objectsEqual) { 228 String thisCarrierServiceName = getCarrierServiceName(); 229 String thatCarrierServiceName = that.getCarrierServiceName(); 230 231 if(thisCarrierServiceName == null) { 232 objectsEqual = objectsEqual && (thatCarrierServiceName == null); 233 } else { 234 objectsEqual = objectsEqual && thisCarrierServiceName.equals(thatCarrierServiceName); 235 } 236 } 237 238 if(objectsEqual) { 239 SelectorPK thisGeoCodeSelectorPK = getGeoCodeSelectorPK(); 240 SelectorPK thatGeoCodeSelectorPK = that.getGeoCodeSelectorPK(); 241 242 if(thisGeoCodeSelectorPK == null) { 243 objectsEqual = objectsEqual && (thatGeoCodeSelectorPK == null); 244 } else { 245 objectsEqual = objectsEqual && thisGeoCodeSelectorPK.equals(thatGeoCodeSelectorPK); 246 } 247 } 248 249 if(objectsEqual) { 250 SelectorPK thisItemSelectorPK = getItemSelectorPK(); 251 SelectorPK thatItemSelectorPK = that.getItemSelectorPK(); 252 253 if(thisItemSelectorPK == null) { 254 objectsEqual = objectsEqual && (thatItemSelectorPK == null); 255 } else { 256 objectsEqual = objectsEqual && thisItemSelectorPK.equals(thatItemSelectorPK); 257 } 258 } 259 260 if(objectsEqual) { 261 Boolean thisIsDefault = getIsDefault(); 262 Boolean thatIsDefault = that.getIsDefault(); 263 264 if(thisIsDefault == null) { 265 objectsEqual = objectsEqual && (thatIsDefault == null); 266 } else { 267 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 268 } 269 } 270 271 if(objectsEqual) { 272 Integer thisSortOrder = getSortOrder(); 273 Integer thatSortOrder = that.getSortOrder(); 274 275 if(thisSortOrder == null) { 276 objectsEqual = objectsEqual && (thatSortOrder == null); 277 } else { 278 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 279 } 280 } 281 282 if(objectsEqual) { 283 Long thisFromTime = getFromTime(); 284 Long thatFromTime = that.getFromTime(); 285 286 if(thisFromTime == null) { 287 objectsEqual = objectsEqual && (thatFromTime == null); 288 } else { 289 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 290 } 291 } 292 293 if(objectsEqual) { 294 Long thisThruTime = getThruTime(); 295 Long thatThruTime = that.getThruTime(); 296 297 if(thisThruTime == null) { 298 objectsEqual = objectsEqual && (thatThruTime == null); 299 } else { 300 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 301 } 302 } 303 304 return objectsEqual; 305 } else { 306 return false; 307 } 308 } 309 310 @Override 311 public boolean hasBeenModified() { 312 return carrierServicePKHasBeenModified || carrierPartyPKHasBeenModified || carrierServiceNameHasBeenModified || geoCodeSelectorPKHasBeenModified || itemSelectorPKHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 313 } 314 315 @Override 316 public void clearHasBeenModified() { 317 carrierServicePKHasBeenModified = false; 318 carrierPartyPKHasBeenModified = false; 319 carrierServiceNameHasBeenModified = false; 320 geoCodeSelectorPKHasBeenModified = false; 321 itemSelectorPKHasBeenModified = false; 322 isDefaultHasBeenModified = false; 323 sortOrderHasBeenModified = false; 324 fromTimeHasBeenModified = false; 325 thruTimeHasBeenModified = false; 326 } 327 328 public CarrierServicePK getCarrierServicePK() { 329 return carrierServicePK; 330 } 331 332 public void setCarrierServicePK(CarrierServicePK carrierServicePK) 333 throws PersistenceNotNullException { 334 checkForNull(carrierServicePK); 335 336 boolean update = true; 337 338 if(this.carrierServicePK != null) { 339 if(this.carrierServicePK.equals(carrierServicePK)) { 340 update = false; 341 } 342 } else if(carrierServicePK == null) { 343 update = false; 344 } 345 346 if(update) { 347 this.carrierServicePK = carrierServicePK; 348 carrierServicePKHasBeenModified = true; 349 clearHashAndString(); 350 } 351 } 352 353 public boolean getCarrierServicePKHasBeenModified() { 354 return carrierServicePKHasBeenModified; 355 } 356 357 public PartyPK getCarrierPartyPK() { 358 return carrierPartyPK; 359 } 360 361 public void setCarrierPartyPK(PartyPK carrierPartyPK) 362 throws PersistenceNotNullException { 363 checkForNull(carrierPartyPK); 364 365 boolean update = true; 366 367 if(this.carrierPartyPK != null) { 368 if(this.carrierPartyPK.equals(carrierPartyPK)) { 369 update = false; 370 } 371 } else if(carrierPartyPK == null) { 372 update = false; 373 } 374 375 if(update) { 376 this.carrierPartyPK = carrierPartyPK; 377 carrierPartyPKHasBeenModified = true; 378 clearHashAndString(); 379 } 380 } 381 382 public boolean getCarrierPartyPKHasBeenModified() { 383 return carrierPartyPKHasBeenModified; 384 } 385 386 public String getCarrierServiceName() { 387 return carrierServiceName; 388 } 389 390 public void setCarrierServiceName(String carrierServiceName) 391 throws PersistenceNotNullException { 392 checkForNull(carrierServiceName); 393 394 boolean update = true; 395 396 if(this.carrierServiceName != null) { 397 if(this.carrierServiceName.equals(carrierServiceName)) { 398 update = false; 399 } 400 } else if(carrierServiceName == null) { 401 update = false; 402 } 403 404 if(update) { 405 this.carrierServiceName = carrierServiceName; 406 carrierServiceNameHasBeenModified = true; 407 clearHashAndString(); 408 } 409 } 410 411 public boolean getCarrierServiceNameHasBeenModified() { 412 return carrierServiceNameHasBeenModified; 413 } 414 415 public SelectorPK getGeoCodeSelectorPK() { 416 return geoCodeSelectorPK; 417 } 418 419 public void setGeoCodeSelectorPK(SelectorPK geoCodeSelectorPK) { 420 boolean update = true; 421 422 if(this.geoCodeSelectorPK != null) { 423 if(this.geoCodeSelectorPK.equals(geoCodeSelectorPK)) { 424 update = false; 425 } 426 } else if(geoCodeSelectorPK == null) { 427 update = false; 428 } 429 430 if(update) { 431 this.geoCodeSelectorPK = geoCodeSelectorPK; 432 geoCodeSelectorPKHasBeenModified = true; 433 clearHashAndString(); 434 } 435 } 436 437 public boolean getGeoCodeSelectorPKHasBeenModified() { 438 return geoCodeSelectorPKHasBeenModified; 439 } 440 441 public SelectorPK getItemSelectorPK() { 442 return itemSelectorPK; 443 } 444 445 public void setItemSelectorPK(SelectorPK itemSelectorPK) { 446 boolean update = true; 447 448 if(this.itemSelectorPK != null) { 449 if(this.itemSelectorPK.equals(itemSelectorPK)) { 450 update = false; 451 } 452 } else if(itemSelectorPK == null) { 453 update = false; 454 } 455 456 if(update) { 457 this.itemSelectorPK = itemSelectorPK; 458 itemSelectorPKHasBeenModified = true; 459 clearHashAndString(); 460 } 461 } 462 463 public boolean getItemSelectorPKHasBeenModified() { 464 return itemSelectorPKHasBeenModified; 465 } 466 467 public Boolean getIsDefault() { 468 return isDefault; 469 } 470 471 public void setIsDefault(Boolean isDefault) 472 throws PersistenceNotNullException { 473 checkForNull(isDefault); 474 475 boolean update = true; 476 477 if(this.isDefault != null) { 478 if(this.isDefault.equals(isDefault)) { 479 update = false; 480 } 481 } else if(isDefault == null) { 482 update = false; 483 } 484 485 if(update) { 486 this.isDefault = isDefault; 487 isDefaultHasBeenModified = true; 488 clearHashAndString(); 489 } 490 } 491 492 public boolean getIsDefaultHasBeenModified() { 493 return isDefaultHasBeenModified; 494 } 495 496 public Integer getSortOrder() { 497 return sortOrder; 498 } 499 500 public void setSortOrder(Integer sortOrder) 501 throws PersistenceNotNullException { 502 checkForNull(sortOrder); 503 504 boolean update = true; 505 506 if(this.sortOrder != null) { 507 if(this.sortOrder.equals(sortOrder)) { 508 update = false; 509 } 510 } else if(sortOrder == null) { 511 update = false; 512 } 513 514 if(update) { 515 this.sortOrder = sortOrder; 516 sortOrderHasBeenModified = true; 517 clearHashAndString(); 518 } 519 } 520 521 public boolean getSortOrderHasBeenModified() { 522 return sortOrderHasBeenModified; 523 } 524 525 public Long getFromTime() { 526 return fromTime; 527 } 528 529 public void setFromTime(Long fromTime) 530 throws PersistenceNotNullException { 531 checkForNull(fromTime); 532 533 boolean update = true; 534 535 if(this.fromTime != null) { 536 if(this.fromTime.equals(fromTime)) { 537 update = false; 538 } 539 } else if(fromTime == null) { 540 update = false; 541 } 542 543 if(update) { 544 this.fromTime = fromTime; 545 fromTimeHasBeenModified = true; 546 clearHashAndString(); 547 } 548 } 549 550 public boolean getFromTimeHasBeenModified() { 551 return fromTimeHasBeenModified; 552 } 553 554 public Long getThruTime() { 555 return thruTime; 556 } 557 558 public void setThruTime(Long thruTime) 559 throws PersistenceNotNullException { 560 checkForNull(thruTime); 561 562 boolean update = true; 563 564 if(this.thruTime != null) { 565 if(this.thruTime.equals(thruTime)) { 566 update = false; 567 } 568 } else if(thruTime == null) { 569 update = false; 570 } 571 572 if(update) { 573 this.thruTime = thruTime; 574 thruTimeHasBeenModified = true; 575 clearHashAndString(); 576 } 577 } 578 579 public boolean getThruTimeHasBeenModified() { 580 return thruTimeHasBeenModified; 581 } 582 583}