Class DefaultSavedPaymentMethodVersionValidationService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.validation.DefaultSavedPaymentMethodVersionValidationService
- All Implemented Interfaces:
SavedPaymentMethodVersionValidationService
public class DefaultSavedPaymentMethodVersionValidationService
extends Object
implements SavedPaymentMethodVersionValidationService
The default implementation of
SavedPaymentMethodVersionValidationService
.- Author:
- Chris Kittrell (ckittrell), Sunny Yu
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validateVersionForArchival
(@NonNull SavedPaymentMethod savedPaymentMethod, Integer versionToTest) Determines if the providedversionToTest
is valid for an archival of theSavedPaymentMethod
.void
validateVersionForUpdate
(@NonNull SavedPaymentMethod savedPaymentMethod, Integer versionToTest) Determines if the providedversionToTest
is valid for an update of theSavedPaymentMethod
.boolean
versionIsStale
(@NonNull SavedPaymentMethod savedPaymentMethod, @NonNull Integer versionToTest) Determines if the providedversionToTest
is valid for theSavedPaymentMethod
.
-
Constructor Details
-
DefaultSavedPaymentMethodVersionValidationService
public DefaultSavedPaymentMethodVersionValidationService()
-
-
Method Details
-
versionIsStale
public boolean versionIsStale(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @NonNull @NonNull Integer versionToTest) Description copied from interface:SavedPaymentMethodVersionValidationService
Determines if the providedversionToTest
is valid for theSavedPaymentMethod
.- Specified by:
versionIsStale
in interfaceSavedPaymentMethodVersionValidationService
- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
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 theSavedPaymentMethod
.
-
validateVersionForUpdate
public void validateVersionForUpdate(@NonNull @NonNull SavedPaymentMethod savedPaymentMethod, @Nullable Integer versionToTest) Description copied from interface:SavedPaymentMethodVersionValidationService
Determines if the providedversionToTest
is valid for an update of theSavedPaymentMethod
.- Specified by:
validateVersionForUpdate
in interfaceSavedPaymentMethodVersionValidationService
- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
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 @NonNull SavedPaymentMethod savedPaymentMethod, @Nullable Integer versionToTest) Description copied from interface:SavedPaymentMethodVersionValidationService
Determines if the providedversionToTest
is valid for an archival of theSavedPaymentMethod
.- Specified by:
validateVersionForArchival
in interfaceSavedPaymentMethodVersionValidationService
- Parameters:
savedPaymentMethod
- TheSavedPaymentMethod
whose version is being validated.versionToTest
- The version provided by the request, which may or may not be out of date.
-