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 * ContactPostalAddressCorrection.java 021 */ 022 023package com.echothree.model.data.contact.server.entity; 024 025import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK; 026 027import com.echothree.model.data.contact.common.pk.ContactMechanismPK; 028import com.echothree.model.data.geo.common.pk.GeoCodePK; 029 030import com.echothree.model.data.contact.server.entity.ContactMechanism; 031import com.echothree.model.data.geo.server.entity.GeoCode; 032 033import com.echothree.model.data.contact.server.factory.ContactMechanismFactory; 034import com.echothree.model.data.geo.server.factory.GeoCodeFactory; 035 036import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK; 037 038import com.echothree.model.data.contact.server.value.ContactPostalAddressCorrectionValue; 039 040import com.echothree.model.data.contact.server.factory.ContactPostalAddressCorrectionFactory; 041 042import com.echothree.util.common.exception.PersistenceException; 043import com.echothree.util.common.exception.PersistenceDatabaseException; 044import com.echothree.util.common.exception.PersistenceNotNullException; 045import com.echothree.util.common.exception.PersistenceReadOnlyException; 046 047import com.echothree.util.common.persistence.BasePK; 048 049import com.echothree.util.common.persistence.type.ByteArray; 050 051import com.echothree.util.server.persistence.BaseEntity; 052import com.echothree.util.server.persistence.EntityPermission; 053import com.echothree.util.server.persistence.Session; 054import com.echothree.util.server.persistence.ThreadSession; 055 056import java.io.Serializable; 057 058import javax.annotation.Nonnull; 059import javax.annotation.Nullable; 060 061public class ContactPostalAddressCorrection 062 extends BaseEntity 063 implements Serializable { 064 065 private ContactPostalAddressCorrectionPK _pk; 066 private ContactPostalAddressCorrectionValue _value; 067 068 /** Creates a new instance of ContactPostalAddressCorrection */ 069 public ContactPostalAddressCorrection() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of ContactPostalAddressCorrection */ 075 public ContactPostalAddressCorrection(ContactPostalAddressCorrectionValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 @Nonnull 084 public ContactPostalAddressCorrectionFactory getBaseFactoryInstance() { 085 return ContactPostalAddressCorrectionFactory.getInstance(); 086 } 087 088 @Override 089 public boolean hasBeenModified() { 090 return _value.hasBeenModified(); 091 } 092 093 @Override 094 public int hashCode() { 095 return _pk.hashCode(); 096 } 097 098 @Override 099 @Nonnull 100 public String toString() { 101 return _pk.toString(); 102 } 103 104 @Override 105 public boolean equals(Object other) { 106 if(this == other) 107 return true; 108 109 if(other instanceof ContactPostalAddressCorrection that) { 110 ContactPostalAddressCorrectionValue thatValue = that.getContactPostalAddressCorrectionValue(); 111 return _value.equals(thatValue); 112 } else { 113 return false; 114 } 115 } 116 117 @Override 118 public void store() 119 throws PersistenceDatabaseException { 120 getBaseFactoryInstance().store(this); 121 } 122 123 @Override 124 public void remove() 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().remove(this); 127 } 128 129 @Nonnull 130 public ContactPostalAddressCorrectionValue getContactPostalAddressCorrectionValue() { 131 return _value; 132 } 133 134 public void setContactPostalAddressCorrectionValue(@Nonnull ContactPostalAddressCorrectionValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 @Nonnull 142 public ContactPostalAddressCorrectionPK getPrimaryKey() { 143 return _pk; 144 } 145 146 @Nonnull 147 public ContactMechanismPK getContactMechanismPK() { 148 return _value.getContactMechanismPK(); 149 } 150 151 @Nonnull 152 public ContactMechanism getContactMechanism(EntityPermission entityPermission) { 153 return ContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getContactMechanismPK()); 154 } 155 156 @Nonnull 157 public ContactMechanism getContactMechanism() { 158 return getContactMechanism(EntityPermission.READ_ONLY); 159 } 160 161 @Nonnull 162 public ContactMechanism getContactMechanismForUpdate() { 163 return getContactMechanism(EntityPermission.READ_WRITE); 164 } 165 166 public void setContactMechanismPK(@Nonnull ContactMechanismPK contactMechanismPK) 167 throws PersistenceNotNullException, PersistenceReadOnlyException { 168 checkReadWrite(); 169 _value.setContactMechanismPK(contactMechanismPK); 170 } 171 172 public void setContactMechanism(@Nonnull ContactMechanism entity) { 173 setContactMechanismPK(entity == null ? null : entity.getPrimaryKey()); 174 } 175 176 public boolean getContactMechanismPKHasBeenModified() { 177 return _value.getContactMechanismPKHasBeenModified(); 178 } 179 180 @Nonnull 181 public String getAddress1() { 182 return _value.getAddress1(); 183 } 184 185 public void setAddress1(@Nonnull String address1) 186 throws PersistenceNotNullException, PersistenceReadOnlyException { 187 checkReadWrite(); 188 _value.setAddress1(address1); 189 } 190 191 public boolean getAddress1HasBeenModified() { 192 return _value.getAddress1HasBeenModified(); 193 } 194 195 @Nullable 196 public String getAddress2() { 197 return _value.getAddress2(); 198 } 199 200 public void setAddress2(@Nullable String address2) 201 throws PersistenceNotNullException, PersistenceReadOnlyException { 202 checkReadWrite(); 203 _value.setAddress2(address2); 204 } 205 206 public boolean getAddress2HasBeenModified() { 207 return _value.getAddress2HasBeenModified(); 208 } 209 210 @Nullable 211 public String getAddress3() { 212 return _value.getAddress3(); 213 } 214 215 public void setAddress3(@Nullable String address3) 216 throws PersistenceNotNullException, PersistenceReadOnlyException { 217 checkReadWrite(); 218 _value.setAddress3(address3); 219 } 220 221 public boolean getAddress3HasBeenModified() { 222 return _value.getAddress3HasBeenModified(); 223 } 224 225 @Nonnull 226 public String getCity() { 227 return _value.getCity(); 228 } 229 230 public void setCity(@Nonnull String city) 231 throws PersistenceNotNullException, PersistenceReadOnlyException { 232 checkReadWrite(); 233 _value.setCity(city); 234 } 235 236 public boolean getCityHasBeenModified() { 237 return _value.getCityHasBeenModified(); 238 } 239 240 @Nullable 241 public GeoCodePK getCityGeoCodePK() { 242 return _value.getCityGeoCodePK(); 243 } 244 245 @Nullable 246 public GeoCode getCityGeoCode(EntityPermission entityPermission) { 247 GeoCodePK pk = getCityGeoCodePK(); 248 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 249 250 return entity; 251 } 252 253 @Nullable 254 public GeoCode getCityGeoCode() { 255 return getCityGeoCode(EntityPermission.READ_ONLY); 256 } 257 258 @Nullable 259 public GeoCode getCityGeoCodeForUpdate() { 260 return getCityGeoCode(EntityPermission.READ_WRITE); 261 } 262 263 public void setCityGeoCodePK(@Nullable GeoCodePK cityGeoCodePK) 264 throws PersistenceNotNullException, PersistenceReadOnlyException { 265 checkReadWrite(); 266 _value.setCityGeoCodePK(cityGeoCodePK); 267 } 268 269 public void setCityGeoCode(@Nullable GeoCode entity) { 270 setCityGeoCodePK(entity == null ? null : entity.getPrimaryKey()); 271 } 272 273 public boolean getCityGeoCodePKHasBeenModified() { 274 return _value.getCityGeoCodePKHasBeenModified(); 275 } 276 277 @Nullable 278 public GeoCodePK getCountyGeoCodePK() { 279 return _value.getCountyGeoCodePK(); 280 } 281 282 @Nullable 283 public GeoCode getCountyGeoCode(EntityPermission entityPermission) { 284 GeoCodePK pk = getCountyGeoCodePK(); 285 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 286 287 return entity; 288 } 289 290 @Nullable 291 public GeoCode getCountyGeoCode() { 292 return getCountyGeoCode(EntityPermission.READ_ONLY); 293 } 294 295 @Nullable 296 public GeoCode getCountyGeoCodeForUpdate() { 297 return getCountyGeoCode(EntityPermission.READ_WRITE); 298 } 299 300 public void setCountyGeoCodePK(@Nullable GeoCodePK countyGeoCodePK) 301 throws PersistenceNotNullException, PersistenceReadOnlyException { 302 checkReadWrite(); 303 _value.setCountyGeoCodePK(countyGeoCodePK); 304 } 305 306 public void setCountyGeoCode(@Nullable GeoCode entity) { 307 setCountyGeoCodePK(entity == null ? null : entity.getPrimaryKey()); 308 } 309 310 public boolean getCountyGeoCodePKHasBeenModified() { 311 return _value.getCountyGeoCodePKHasBeenModified(); 312 } 313 314 @Nonnull 315 public String getState() { 316 return _value.getState(); 317 } 318 319 public void setState(@Nonnull String state) 320 throws PersistenceNotNullException, PersistenceReadOnlyException { 321 checkReadWrite(); 322 _value.setState(state); 323 } 324 325 public boolean getStateHasBeenModified() { 326 return _value.getStateHasBeenModified(); 327 } 328 329 @Nullable 330 public GeoCodePK getStateGeoCodePK() { 331 return _value.getStateGeoCodePK(); 332 } 333 334 @Nullable 335 public GeoCode getStateGeoCode(EntityPermission entityPermission) { 336 GeoCodePK pk = getStateGeoCodePK(); 337 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 338 339 return entity; 340 } 341 342 @Nullable 343 public GeoCode getStateGeoCode() { 344 return getStateGeoCode(EntityPermission.READ_ONLY); 345 } 346 347 @Nullable 348 public GeoCode getStateGeoCodeForUpdate() { 349 return getStateGeoCode(EntityPermission.READ_WRITE); 350 } 351 352 public void setStateGeoCodePK(@Nullable GeoCodePK stateGeoCodePK) 353 throws PersistenceNotNullException, PersistenceReadOnlyException { 354 checkReadWrite(); 355 _value.setStateGeoCodePK(stateGeoCodePK); 356 } 357 358 public void setStateGeoCode(@Nullable GeoCode entity) { 359 setStateGeoCodePK(entity == null ? null : entity.getPrimaryKey()); 360 } 361 362 public boolean getStateGeoCodePKHasBeenModified() { 363 return _value.getStateGeoCodePKHasBeenModified(); 364 } 365 366 @Nonnull 367 public String getPostalCode() { 368 return _value.getPostalCode(); 369 } 370 371 public void setPostalCode(@Nonnull String postalCode) 372 throws PersistenceNotNullException, PersistenceReadOnlyException { 373 checkReadWrite(); 374 _value.setPostalCode(postalCode); 375 } 376 377 public boolean getPostalCodeHasBeenModified() { 378 return _value.getPostalCodeHasBeenModified(); 379 } 380 381 @Nullable 382 public GeoCodePK getPostalCodeGeoCodePK() { 383 return _value.getPostalCodeGeoCodePK(); 384 } 385 386 @Nullable 387 public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) { 388 GeoCodePK pk = getPostalCodeGeoCodePK(); 389 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 390 391 return entity; 392 } 393 394 @Nullable 395 public GeoCode getPostalCodeGeoCode() { 396 return getPostalCodeGeoCode(EntityPermission.READ_ONLY); 397 } 398 399 @Nullable 400 public GeoCode getPostalCodeGeoCodeForUpdate() { 401 return getPostalCodeGeoCode(EntityPermission.READ_WRITE); 402 } 403 404 public void setPostalCodeGeoCodePK(@Nullable GeoCodePK postalCodeGeoCodePK) 405 throws PersistenceNotNullException, PersistenceReadOnlyException { 406 checkReadWrite(); 407 _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK); 408 } 409 410 public void setPostalCodeGeoCode(@Nullable GeoCode entity) { 411 setPostalCodeGeoCodePK(entity == null ? null : entity.getPrimaryKey()); 412 } 413 414 public boolean getPostalCodeGeoCodePKHasBeenModified() { 415 return _value.getPostalCodeGeoCodePKHasBeenModified(); 416 } 417 418 @Nonnull 419 public GeoCodePK getCountryGeoCodePK() { 420 return _value.getCountryGeoCodePK(); 421 } 422 423 @Nonnull 424 public GeoCode getCountryGeoCode(EntityPermission entityPermission) { 425 return GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, getCountryGeoCodePK()); 426 } 427 428 @Nonnull 429 public GeoCode getCountryGeoCode() { 430 return getCountryGeoCode(EntityPermission.READ_ONLY); 431 } 432 433 @Nonnull 434 public GeoCode getCountryGeoCodeForUpdate() { 435 return getCountryGeoCode(EntityPermission.READ_WRITE); 436 } 437 438 public void setCountryGeoCodePK(@Nonnull GeoCodePK countryGeoCodePK) 439 throws PersistenceNotNullException, PersistenceReadOnlyException { 440 checkReadWrite(); 441 _value.setCountryGeoCodePK(countryGeoCodePK); 442 } 443 444 public void setCountryGeoCode(@Nonnull GeoCode entity) { 445 setCountryGeoCodePK(entity == null ? null : entity.getPrimaryKey()); 446 } 447 448 public boolean getCountryGeoCodePKHasBeenModified() { 449 return _value.getCountryGeoCodePKHasBeenModified(); 450 } 451 452 @Nonnull 453 public Long getFromTime() { 454 return _value.getFromTime(); 455 } 456 457 public void setFromTime(@Nonnull Long fromTime) 458 throws PersistenceNotNullException, PersistenceReadOnlyException { 459 checkReadWrite(); 460 _value.setFromTime(fromTime); 461 } 462 463 public boolean getFromTimeHasBeenModified() { 464 return _value.getFromTimeHasBeenModified(); 465 } 466 467 @Nonnull 468 public Long getThruTime() { 469 return _value.getThruTime(); 470 } 471 472 public void setThruTime(@Nonnull Long thruTime) 473 throws PersistenceNotNullException, PersistenceReadOnlyException { 474 checkReadWrite(); 475 _value.setThruTime(thruTime); 476 } 477 478 public boolean getThruTimeHasBeenModified() { 479 return _value.getThruTimeHasBeenModified(); 480 } 481 482}