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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidateVersionForArchival(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for an archival of thePaymentTransaction.voidvalidateVersionForUpdate(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for an update of thePaymentTransaction.booleanversionIsStale(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for thePaymentTransaction.
-
Constructor Details
-
DefaultPaymentTransactionVersionValidationService
public DefaultPaymentTransactionVersionValidationService()
-
-
Method Details
-
versionIsStale
public boolean versionIsStale(@NonNull PaymentTransaction paymentTransaction, @NonNull Integer versionToTest) Description copied from interface:PaymentTransactionVersionValidationServiceDetermines if the providedversionToTestis valid for thePaymentTransaction.- Specified by:
versionIsStalein interfacePaymentTransactionVersionValidationService- Parameters:
paymentTransaction- ThePaymentTransactionwhose version is being validated.versionToTest- The version provided by the request, which may or may not be out of date.- Returns:
- Whether the provided
versionToTestis valid for thePaymentTransaction.
-
validateVersionForUpdate
public void validateVersionForUpdate(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest) Description copied from interface:PaymentTransactionVersionValidationServiceDetermines if the providedversionToTestis valid for an update of thePaymentTransaction.- Specified by:
validateVersionForUpdatein interfacePaymentTransactionVersionValidationService- Parameters:
paymentTransaction- ThePaymentTransactionwhose 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:PaymentTransactionVersionValidationServiceDetermines if the providedversionToTestis valid for an archival of thePaymentTransaction.- Specified by:
validateVersionForArchivalin interfacePaymentTransactionVersionValidationService- Parameters:
paymentTransaction- ThePaymentTransactionwhose version is being validated.versionToTest- The version provided by the request, which may or may not be out of date.
-