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 * PaymentProcessorTransactionCodeValue.java 021 */ 022 023package com.echothree.model.data.payment.server.value; 024 025import com.echothree.model.data.payment.common.pk.PaymentProcessorTransactionCodePK; 026 027import com.echothree.model.data.payment.server.factory.PaymentProcessorTransactionCodeFactory; 028 029import com.echothree.model.data.payment.common.pk.PaymentProcessorTransactionPK; 030import com.echothree.model.data.payment.common.pk.PaymentProcessorTypeCodePK; 031 032import com.echothree.util.common.exception.PersistenceCloneException; 033import com.echothree.util.common.exception.PersistenceNotNullException; 034 035import com.echothree.util.server.persistence.BaseValue; 036 037import java.io.Serializable; 038 039import javax.annotation.Nonnull; 040import javax.annotation.Nullable; 041 042public class PaymentProcessorTransactionCodeValue 043 extends BaseValue<PaymentProcessorTransactionCodePK> 044 implements Cloneable, Serializable { 045 046 private PaymentProcessorTransactionPK paymentProcessorTransactionPK; 047 private boolean paymentProcessorTransactionPKHasBeenModified = false; 048 private PaymentProcessorTypeCodePK paymentProcessorTypeCodePK; 049 private boolean paymentProcessorTypeCodePKHasBeenModified = false; 050 private Long fromTime; 051 private boolean fromTimeHasBeenModified = false; 052 private Long thruTime; 053 private boolean thruTimeHasBeenModified = false; 054 055 private transient Integer _hashCode = null; 056 private transient String _stringValue = null; 057 058 private void constructFields(PaymentProcessorTransactionPK paymentProcessorTransactionPK, PaymentProcessorTypeCodePK paymentProcessorTypeCodePK, Long fromTime, Long thruTime) 059 throws PersistenceNotNullException { 060 checkForNull(paymentProcessorTransactionPK); 061 this.paymentProcessorTransactionPK = paymentProcessorTransactionPK; 062 checkForNull(paymentProcessorTypeCodePK); 063 this.paymentProcessorTypeCodePK = paymentProcessorTypeCodePK; 064 checkForNull(fromTime); 065 this.fromTime = fromTime; 066 checkForNull(thruTime); 067 this.thruTime = thruTime; 068 } 069 070 /** Creates a new instance of PaymentProcessorTransactionCodeValue */ 071 public PaymentProcessorTransactionCodeValue(PaymentProcessorTransactionCodePK paymentProcessorTransactionCodePK, PaymentProcessorTransactionPK paymentProcessorTransactionPK, PaymentProcessorTypeCodePK paymentProcessorTypeCodePK, Long fromTime, Long thruTime) 072 throws PersistenceNotNullException { 073 super(paymentProcessorTransactionCodePK); 074 constructFields(paymentProcessorTransactionPK, paymentProcessorTypeCodePK, fromTime, thruTime); 075 } 076 077 /** Creates a new instance of PaymentProcessorTransactionCodeValue */ 078 public PaymentProcessorTransactionCodeValue(PaymentProcessorTransactionPK paymentProcessorTransactionPK, PaymentProcessorTypeCodePK paymentProcessorTypeCodePK, Long fromTime, Long thruTime) 079 throws PersistenceNotNullException { 080 super(); 081 constructFields(paymentProcessorTransactionPK, paymentProcessorTypeCodePK, fromTime, thruTime); 082 } 083 084 @Override 085 @Nonnull 086 public PaymentProcessorTransactionCodeFactory getBaseFactoryInstance() { 087 return PaymentProcessorTransactionCodeFactory.getInstance(); 088 } 089 090 @Override 091 @Nonnull 092 public PaymentProcessorTransactionCodeValue clone() { 093 Object result; 094 095 try { 096 result = super.clone(); 097 } catch (CloneNotSupportedException cnse) { 098 // This shouldn't happen, fail when it does. 099 throw new PersistenceCloneException(cnse); 100 } 101 102 return (PaymentProcessorTransactionCodeValue)result; 103 } 104 105 @Override 106 @Nonnull 107 public PaymentProcessorTransactionCodePK getPrimaryKey() { 108 if(_primaryKey == null) { 109 _primaryKey = new PaymentProcessorTransactionCodePK(entityId); 110 } 111 112 return _primaryKey; 113 } 114 115 private void clearHashAndString() { 116 _hashCode = null; 117 _stringValue = null; 118 } 119 120 @Override 121 public int hashCode() { 122 if(_hashCode == null) { 123 int hashCode = 17; 124 125 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 126 127 hashCode = 37 * hashCode + ((paymentProcessorTransactionPK != null) ? paymentProcessorTransactionPK.hashCode() : 0); 128 hashCode = 37 * hashCode + ((paymentProcessorTypeCodePK != null) ? paymentProcessorTypeCodePK.hashCode() : 0); 129 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 130 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 131 132 _hashCode = hashCode; 133 } 134 135 return _hashCode; 136 } 137 138 @Override 139 @Nonnull 140 public String toString() { 141 if(_stringValue == null) { 142 _stringValue = "{" + 143 "entityId=" + getEntityId() + 144 ", paymentProcessorTransactionPK=" + getPaymentProcessorTransactionPK() + 145 ", paymentProcessorTypeCodePK=" + getPaymentProcessorTypeCodePK() + 146 ", fromTime=" + getFromTime() + 147 ", thruTime=" + getThruTime() + 148 "}"; 149 } 150 return _stringValue; 151 } 152 153 @Override 154 public boolean equals(Object other) { 155 if(this == other) 156 return true; 157 158 if(!hasIdentity()) 159 return false; 160 161 if(other instanceof PaymentProcessorTransactionCodeValue that) { 162 if(!that.hasIdentity()) 163 return false; 164 165 Long thisEntityId = getEntityId(); 166 Long thatEntityId = that.getEntityId(); 167 168 boolean objectsEqual = thisEntityId.equals(thatEntityId); 169 if(objectsEqual) 170 objectsEqual = isIdentical(that); 171 172 return objectsEqual; 173 } else { 174 return false; 175 } 176 } 177 178 public boolean isIdentical(Object other) { 179 if(other instanceof PaymentProcessorTransactionCodeValue that) { 180 boolean objectsEqual = true; 181 182 183 if(objectsEqual) { 184 PaymentProcessorTransactionPK thisPaymentProcessorTransactionPK = getPaymentProcessorTransactionPK(); 185 PaymentProcessorTransactionPK thatPaymentProcessorTransactionPK = that.getPaymentProcessorTransactionPK(); 186 187 if(thisPaymentProcessorTransactionPK == null) { 188 objectsEqual = objectsEqual && (thatPaymentProcessorTransactionPK == null); 189 } else { 190 objectsEqual = objectsEqual && thisPaymentProcessorTransactionPK.equals(thatPaymentProcessorTransactionPK); 191 } 192 } 193 194 if(objectsEqual) { 195 PaymentProcessorTypeCodePK thisPaymentProcessorTypeCodePK = getPaymentProcessorTypeCodePK(); 196 PaymentProcessorTypeCodePK thatPaymentProcessorTypeCodePK = that.getPaymentProcessorTypeCodePK(); 197 198 if(thisPaymentProcessorTypeCodePK == null) { 199 objectsEqual = objectsEqual && (thatPaymentProcessorTypeCodePK == null); 200 } else { 201 objectsEqual = objectsEqual && thisPaymentProcessorTypeCodePK.equals(thatPaymentProcessorTypeCodePK); 202 } 203 } 204 205 if(objectsEqual) { 206 Long thisFromTime = getFromTime(); 207 Long thatFromTime = that.getFromTime(); 208 209 if(thisFromTime == null) { 210 objectsEqual = objectsEqual && (thatFromTime == null); 211 } else { 212 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 213 } 214 } 215 216 if(objectsEqual) { 217 Long thisThruTime = getThruTime(); 218 Long thatThruTime = that.getThruTime(); 219 220 if(thisThruTime == null) { 221 objectsEqual = objectsEqual && (thatThruTime == null); 222 } else { 223 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 224 } 225 } 226 227 return objectsEqual; 228 } else { 229 return false; 230 } 231 } 232 233 @Override 234 public boolean hasBeenModified() { 235 return paymentProcessorTransactionPKHasBeenModified || paymentProcessorTypeCodePKHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 236 } 237 238 @Override 239 public void clearHasBeenModified() { 240 paymentProcessorTransactionPKHasBeenModified = false; 241 paymentProcessorTypeCodePKHasBeenModified = false; 242 fromTimeHasBeenModified = false; 243 thruTimeHasBeenModified = false; 244 } 245 246 @Nonnull 247 public PaymentProcessorTransactionPK getPaymentProcessorTransactionPK() { 248 return paymentProcessorTransactionPK; 249 } 250 251 public void setPaymentProcessorTransactionPK(@Nonnull PaymentProcessorTransactionPK paymentProcessorTransactionPK) 252 throws PersistenceNotNullException { 253 checkForNull(paymentProcessorTransactionPK); 254 255 boolean update = true; 256 257 if(this.paymentProcessorTransactionPK != null) { 258 if(this.paymentProcessorTransactionPK.equals(paymentProcessorTransactionPK)) { 259 update = false; 260 } 261 } else if(paymentProcessorTransactionPK == null) { 262 update = false; 263 } 264 265 if(update) { 266 this.paymentProcessorTransactionPK = paymentProcessorTransactionPK; 267 paymentProcessorTransactionPKHasBeenModified = true; 268 clearHashAndString(); 269 } 270 } 271 272 public boolean getPaymentProcessorTransactionPKHasBeenModified() { 273 return paymentProcessorTransactionPKHasBeenModified; 274 } 275 276 @Nonnull 277 public PaymentProcessorTypeCodePK getPaymentProcessorTypeCodePK() { 278 return paymentProcessorTypeCodePK; 279 } 280 281 public void setPaymentProcessorTypeCodePK(@Nonnull PaymentProcessorTypeCodePK paymentProcessorTypeCodePK) 282 throws PersistenceNotNullException { 283 checkForNull(paymentProcessorTypeCodePK); 284 285 boolean update = true; 286 287 if(this.paymentProcessorTypeCodePK != null) { 288 if(this.paymentProcessorTypeCodePK.equals(paymentProcessorTypeCodePK)) { 289 update = false; 290 } 291 } else if(paymentProcessorTypeCodePK == null) { 292 update = false; 293 } 294 295 if(update) { 296 this.paymentProcessorTypeCodePK = paymentProcessorTypeCodePK; 297 paymentProcessorTypeCodePKHasBeenModified = true; 298 clearHashAndString(); 299 } 300 } 301 302 public boolean getPaymentProcessorTypeCodePKHasBeenModified() { 303 return paymentProcessorTypeCodePKHasBeenModified; 304 } 305 306 @Nonnull 307 public Long getFromTime() { 308 return fromTime; 309 } 310 311 public void setFromTime(@Nonnull Long fromTime) 312 throws PersistenceNotNullException { 313 checkForNull(fromTime); 314 315 boolean update = true; 316 317 if(this.fromTime != null) { 318 if(this.fromTime.equals(fromTime)) { 319 update = false; 320 } 321 } else if(fromTime == null) { 322 update = false; 323 } 324 325 if(update) { 326 this.fromTime = fromTime; 327 fromTimeHasBeenModified = true; 328 clearHashAndString(); 329 } 330 } 331 332 public boolean getFromTimeHasBeenModified() { 333 return fromTimeHasBeenModified; 334 } 335 336 @Nonnull 337 public Long getThruTime() { 338 return thruTime; 339 } 340 341 public void setThruTime(@Nonnull Long thruTime) 342 throws PersistenceNotNullException { 343 checkForNull(thruTime); 344 345 boolean update = true; 346 347 if(this.thruTime != null) { 348 if(this.thruTime.equals(thruTime)) { 349 update = false; 350 } 351 } else if(thruTime == null) { 352 update = false; 353 } 354 355 if(update) { 356 this.thruTime = thruTime; 357 thruTimeHasBeenModified = true; 358 clearHashAndString(); 359 } 360 } 361 362 public boolean getThruTimeHasBeenModified() { 363 return thruTimeHasBeenModified; 364 } 365 366}