001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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 StringBuilder stringValue = new StringBuilder("{"); 160 161 stringValue.append("entityId=").append(getEntityId()); 162 163 stringValue.append(", carrierServicePK=").append(getCarrierServicePK()); 164 stringValue.append(", carrierPartyPK=").append(getCarrierPartyPK()); 165 stringValue.append(", carrierServiceName=").append(getCarrierServiceName()); 166 stringValue.append(", geoCodeSelectorPK=").append(getGeoCodeSelectorPK()); 167 stringValue.append(", itemSelectorPK=").append(getItemSelectorPK()); 168 stringValue.append(", isDefault=").append(getIsDefault()); 169 stringValue.append(", sortOrder=").append(getSortOrder()); 170 stringValue.append(", fromTime=").append(getFromTime()); 171 stringValue.append(", thruTime=").append(getThruTime()); 172 173 stringValue.append('}'); 174 175 _stringValue = stringValue.toString(); 176 } 177 return _stringValue; 178 } 179 180 @Override 181 public boolean equals(Object other) { 182 if(this == other) 183 return true; 184 185 if(!hasIdentity()) 186 return false; 187 188 if(other instanceof CarrierServiceDetailValue) { 189 CarrierServiceDetailValue that = (CarrierServiceDetailValue)other; 190 191 if(!that.hasIdentity()) 192 return false; 193 194 Long thisEntityId = getEntityId(); 195 Long thatEntityId = that.getEntityId(); 196 197 boolean objectsEqual = thisEntityId.equals(thatEntityId); 198 if(objectsEqual) 199 objectsEqual = objectsEqual && isIdentical(that); 200 201 return objectsEqual; 202 } else { 203 return false; 204 } 205 } 206 207 public boolean isIdentical(Object other) { 208 if(other instanceof CarrierServiceDetailValue) { 209 CarrierServiceDetailValue that = (CarrierServiceDetailValue)other; 210 boolean objectsEqual = true; 211 212 213 if(objectsEqual) { 214 CarrierServicePK thisCarrierServicePK = getCarrierServicePK(); 215 CarrierServicePK thatCarrierServicePK = that.getCarrierServicePK(); 216 217 if(thisCarrierServicePK == null) { 218 objectsEqual = objectsEqual && (thatCarrierServicePK == null); 219 } else { 220 objectsEqual = objectsEqual && thisCarrierServicePK.equals(thatCarrierServicePK); 221 } 222 } 223 224 if(objectsEqual) { 225 PartyPK thisCarrierPartyPK = getCarrierPartyPK(); 226 PartyPK thatCarrierPartyPK = that.getCarrierPartyPK(); 227 228 if(thisCarrierPartyPK == null) { 229 objectsEqual = objectsEqual && (thatCarrierPartyPK == null); 230 } else { 231 objectsEqual = objectsEqual && thisCarrierPartyPK.equals(thatCarrierPartyPK); 232 } 233 } 234 235 if(objectsEqual) { 236 String thisCarrierServiceName = getCarrierServiceName(); 237 String thatCarrierServiceName = that.getCarrierServiceName(); 238 239 if(thisCarrierServiceName == null) { 240 objectsEqual = objectsEqual && (thatCarrierServiceName == null); 241 } else { 242 objectsEqual = objectsEqual && thisCarrierServiceName.equals(thatCarrierServiceName); 243 } 244 } 245 246 if(objectsEqual) { 247 SelectorPK thisGeoCodeSelectorPK = getGeoCodeSelectorPK(); 248 SelectorPK thatGeoCodeSelectorPK = that.getGeoCodeSelectorPK(); 249 250 if(thisGeoCodeSelectorPK == null) { 251 objectsEqual = objectsEqual && (thatGeoCodeSelectorPK == null); 252 } else { 253 objectsEqual = objectsEqual && thisGeoCodeSelectorPK.equals(thatGeoCodeSelectorPK); 254 } 255 } 256 257 if(objectsEqual) { 258 SelectorPK thisItemSelectorPK = getItemSelectorPK(); 259 SelectorPK thatItemSelectorPK = that.getItemSelectorPK(); 260 261 if(thisItemSelectorPK == null) { 262 objectsEqual = objectsEqual && (thatItemSelectorPK == null); 263 } else { 264 objectsEqual = objectsEqual && thisItemSelectorPK.equals(thatItemSelectorPK); 265 } 266 } 267 268 if(objectsEqual) { 269 Boolean thisIsDefault = getIsDefault(); 270 Boolean thatIsDefault = that.getIsDefault(); 271 272 if(thisIsDefault == null) { 273 objectsEqual = objectsEqual && (thatIsDefault == null); 274 } else { 275 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 276 } 277 } 278 279 if(objectsEqual) { 280 Integer thisSortOrder = getSortOrder(); 281 Integer thatSortOrder = that.getSortOrder(); 282 283 if(thisSortOrder == null) { 284 objectsEqual = objectsEqual && (thatSortOrder == null); 285 } else { 286 objectsEqual = objectsEqual && thisSortOrder.equals(thatSortOrder); 287 } 288 } 289 290 if(objectsEqual) { 291 Long thisFromTime = getFromTime(); 292 Long thatFromTime = that.getFromTime(); 293 294 if(thisFromTime == null) { 295 objectsEqual = objectsEqual && (thatFromTime == null); 296 } else { 297 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 298 } 299 } 300 301 if(objectsEqual) { 302 Long thisThruTime = getThruTime(); 303 Long thatThruTime = that.getThruTime(); 304 305 if(thisThruTime == null) { 306 objectsEqual = objectsEqual && (thatThruTime == null); 307 } else { 308 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 309 } 310 } 311 312 return objectsEqual; 313 } else { 314 return false; 315 } 316 } 317 318 @Override 319 public boolean hasBeenModified() { 320 return carrierServicePKHasBeenModified || carrierPartyPKHasBeenModified || carrierServiceNameHasBeenModified || geoCodeSelectorPKHasBeenModified || itemSelectorPKHasBeenModified || isDefaultHasBeenModified || sortOrderHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 321 } 322 323 @Override 324 public void clearHasBeenModified() { 325 carrierServicePKHasBeenModified = false; 326 carrierPartyPKHasBeenModified = false; 327 carrierServiceNameHasBeenModified = false; 328 geoCodeSelectorPKHasBeenModified = false; 329 itemSelectorPKHasBeenModified = false; 330 isDefaultHasBeenModified = false; 331 sortOrderHasBeenModified = false; 332 fromTimeHasBeenModified = false; 333 thruTimeHasBeenModified = false; 334 } 335 336 public CarrierServicePK getCarrierServicePK() { 337 return carrierServicePK; 338 } 339 340 public void setCarrierServicePK(CarrierServicePK carrierServicePK) 341 throws PersistenceNotNullException { 342 checkForNull(carrierServicePK); 343 344 boolean update = true; 345 346 if(this.carrierServicePK != null) { 347 if(this.carrierServicePK.equals(carrierServicePK)) { 348 update = false; 349 } 350 } else if(carrierServicePK == null) { 351 update = false; 352 } 353 354 if(update) { 355 this.carrierServicePK = carrierServicePK; 356 carrierServicePKHasBeenModified = true; 357 clearHashAndString(); 358 } 359 } 360 361 public boolean getCarrierServicePKHasBeenModified() { 362 return carrierServicePKHasBeenModified; 363 } 364 365 public PartyPK getCarrierPartyPK() { 366 return carrierPartyPK; 367 } 368 369 public void setCarrierPartyPK(PartyPK carrierPartyPK) 370 throws PersistenceNotNullException { 371 checkForNull(carrierPartyPK); 372 373 boolean update = true; 374 375 if(this.carrierPartyPK != null) { 376 if(this.carrierPartyPK.equals(carrierPartyPK)) { 377 update = false; 378 } 379 } else if(carrierPartyPK == null) { 380 update = false; 381 } 382 383 if(update) { 384 this.carrierPartyPK = carrierPartyPK; 385 carrierPartyPKHasBeenModified = true; 386 clearHashAndString(); 387 } 388 } 389 390 public boolean getCarrierPartyPKHasBeenModified() { 391 return carrierPartyPKHasBeenModified; 392 } 393 394 public String getCarrierServiceName() { 395 return carrierServiceName; 396 } 397 398 public void setCarrierServiceName(String carrierServiceName) 399 throws PersistenceNotNullException { 400 checkForNull(carrierServiceName); 401 402 boolean update = true; 403 404 if(this.carrierServiceName != null) { 405 if(this.carrierServiceName.equals(carrierServiceName)) { 406 update = false; 407 } 408 } else if(carrierServiceName == null) { 409 update = false; 410 } 411 412 if(update) { 413 this.carrierServiceName = carrierServiceName; 414 carrierServiceNameHasBeenModified = true; 415 clearHashAndString(); 416 } 417 } 418 419 public boolean getCarrierServiceNameHasBeenModified() { 420 return carrierServiceNameHasBeenModified; 421 } 422 423 public SelectorPK getGeoCodeSelectorPK() { 424 return geoCodeSelectorPK; 425 } 426 427 public void setGeoCodeSelectorPK(SelectorPK geoCodeSelectorPK) { 428 boolean update = true; 429 430 if(this.geoCodeSelectorPK != null) { 431 if(this.geoCodeSelectorPK.equals(geoCodeSelectorPK)) { 432 update = false; 433 } 434 } else if(geoCodeSelectorPK == null) { 435 update = false; 436 } 437 438 if(update) { 439 this.geoCodeSelectorPK = geoCodeSelectorPK; 440 geoCodeSelectorPKHasBeenModified = true; 441 clearHashAndString(); 442 } 443 } 444 445 public boolean getGeoCodeSelectorPKHasBeenModified() { 446 return geoCodeSelectorPKHasBeenModified; 447 } 448 449 public SelectorPK getItemSelectorPK() { 450 return itemSelectorPK; 451 } 452 453 public void setItemSelectorPK(SelectorPK itemSelectorPK) { 454 boolean update = true; 455 456 if(this.itemSelectorPK != null) { 457 if(this.itemSelectorPK.equals(itemSelectorPK)) { 458 update = false; 459 } 460 } else if(itemSelectorPK == null) { 461 update = false; 462 } 463 464 if(update) { 465 this.itemSelectorPK = itemSelectorPK; 466 itemSelectorPKHasBeenModified = true; 467 clearHashAndString(); 468 } 469 } 470 471 public boolean getItemSelectorPKHasBeenModified() { 472 return itemSelectorPKHasBeenModified; 473 } 474 475 public Boolean getIsDefault() { 476 return isDefault; 477 } 478 479 public void setIsDefault(Boolean isDefault) 480 throws PersistenceNotNullException { 481 checkForNull(isDefault); 482 483 boolean update = true; 484 485 if(this.isDefault != null) { 486 if(this.isDefault.equals(isDefault)) { 487 update = false; 488 } 489 } else if(isDefault == null) { 490 update = false; 491 } 492 493 if(update) { 494 this.isDefault = isDefault; 495 isDefaultHasBeenModified = true; 496 clearHashAndString(); 497 } 498 } 499 500 public boolean getIsDefaultHasBeenModified() { 501 return isDefaultHasBeenModified; 502 } 503 504 public Integer getSortOrder() { 505 return sortOrder; 506 } 507 508 public void setSortOrder(Integer sortOrder) 509 throws PersistenceNotNullException { 510 checkForNull(sortOrder); 511 512 boolean update = true; 513 514 if(this.sortOrder != null) { 515 if(this.sortOrder.equals(sortOrder)) { 516 update = false; 517 } 518 } else if(sortOrder == null) { 519 update = false; 520 } 521 522 if(update) { 523 this.sortOrder = sortOrder; 524 sortOrderHasBeenModified = true; 525 clearHashAndString(); 526 } 527 } 528 529 public boolean getSortOrderHasBeenModified() { 530 return sortOrderHasBeenModified; 531 } 532 533 public Long getFromTime() { 534 return fromTime; 535 } 536 537 public void setFromTime(Long fromTime) 538 throws PersistenceNotNullException { 539 checkForNull(fromTime); 540 541 boolean update = true; 542 543 if(this.fromTime != null) { 544 if(this.fromTime.equals(fromTime)) { 545 update = false; 546 } 547 } else if(fromTime == null) { 548 update = false; 549 } 550 551 if(update) { 552 this.fromTime = fromTime; 553 fromTimeHasBeenModified = true; 554 clearHashAndString(); 555 } 556 } 557 558 public boolean getFromTimeHasBeenModified() { 559 return fromTimeHasBeenModified; 560 } 561 562 public Long getThruTime() { 563 return thruTime; 564 } 565 566 public void setThruTime(Long thruTime) 567 throws PersistenceNotNullException { 568 checkForNull(thruTime); 569 570 boolean update = true; 571 572 if(this.thruTime != null) { 573 if(this.thruTime.equals(thruTime)) { 574 update = false; 575 } 576 } else if(thruTime == null) { 577 update = false; 578 } 579 580 if(update) { 581 this.thruTime = thruTime; 582 thruTimeHasBeenModified = true; 583 clearHashAndString(); 584 } 585 } 586 587 public boolean getThruTimeHasBeenModified() { 588 return thruTimeHasBeenModified; 589 } 590 591}