Class SkuInventoryReservationRequestValidator
java.lang.Object
com.broadleafcommerce.inventory.service.validation.SkuInventoryReservationRequestValidator
- All Implemented Interfaces:
org.springframework.validation.Validator
public class SkuInventoryReservationRequestValidator
extends Object
implements org.springframework.validation.Validator
Class used to validate a
SkuInventoryReservationRequest
.- Author:
- Nathan Moore (nathandmoore)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
validate
(@NonNull SkuInventoryReservationRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates the request.void
-
Constructor Details
-
SkuInventoryReservationRequestValidator
public SkuInventoryReservationRequestValidator()
-
-
Method Details
-
supports
- Specified by:
supports
in interfaceorg.springframework.validation.Validator
-
validate
public void validate(@NonNull @NonNull @NonNull Object target, @NonNull @NonNull @NonNull org.springframework.validation.Errors errors) - Specified by:
validate
in interfaceorg.springframework.validation.Validator
-
validate
public void validate(@NonNull @NonNull @NonNull SkuInventoryReservationRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Validates the request. This method should throw anIllegalArgumentException
or aValidationException
if there is a condition that does not pass validation.- Parameters:
request
-SkuInventoryReservationRequest
that was made and should be validatedcontextInfo
- Context information around sandbox and multitenant state.- Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if therequest
fails validation
-