Class DefaultPaymentTransactionVersionValidationService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.validation.DefaultPaymentTransactionVersionValidationService
- All Implemented Interfaces:
PaymentTransactionVersionValidationService
public class DefaultPaymentTransactionVersionValidationService
extends Object
implements PaymentTransactionVersionValidationService
The default implementation of
PaymentVersionValidationService
.- Author:
- Chris Kittrell (ckittrell)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validateVersionForArchival
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for an archival of thePaymentTransaction
.void
validateVersionForUpdate
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for an update of thePaymentTransaction
.boolean
versionIsStale
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for thePaymentTransaction
.
-
Constructor Details
-
DefaultPaymentTransactionVersionValidationService
public DefaultPaymentTransactionVersionValidationService()
-
-
Method Details
-
versionIsStale
public boolean versionIsStale(@NonNull PaymentTransaction paymentTransaction, @NonNull Integer versionToTest) Description copied from interface:PaymentTransactionVersionValidationService
Determines if the providedversionToTest
is valid for thePaymentTransaction
.- Specified by:
versionIsStale
in interfacePaymentTransactionVersionValidationService
- Parameters:
paymentTransaction
- ThePaymentTransaction
whose version is being validated.versionToTest
- The version provided by the request, which may or may not be out of date.- Returns:
- Whether the provided
versionToTest
is valid for thePaymentTransaction
.
-
validateVersionForUpdate
public void validateVersionForUpdate(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest) Description copied from interface:PaymentTransactionVersionValidationService
Determines if the providedversionToTest
is valid for an update of thePaymentTransaction
.- Specified by:
validateVersionForUpdate
in interfacePaymentTransactionVersionValidationService
- Parameters:
paymentTransaction
- ThePaymentTransaction
whose version is being validated.versionToTest
- The version provided by the request, which may or may not be out of date.
-
validateVersionForArchival
public void validateVersionForArchival(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest) Description copied from interface:PaymentTransactionVersionValidationService
Determines if the providedversionToTest
is valid for an archival of thePaymentTransaction
.- Specified by:
validateVersionForArchival
in interfacePaymentTransactionVersionValidationService
- Parameters:
paymentTransaction
- ThePaymentTransaction
whose version is being validated.versionToTest
- The version provided by the request, which may or may not be out of date.
-