Class OfferCodeValidator
java.lang.Object
com.broadleafcommerce.promotion.offer.service.validation.OfferCodeValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class OfferCodeValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
OfferCode
.- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
supports
(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
validate
(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateActiveEndDate
(OfferCode campaignCode, org.springframework.validation.Errors errors) protected void
validateCode
(org.springframework.validation.Errors errors) protected void
validateMaxUses
(OfferCode campaignCode, org.springframework.validation.Errors errors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
validateForCreate, validateForReplace, validateForUpdate
-
Constructor Details
-
OfferCodeValidator
public OfferCodeValidator()
-
-
Method Details
-
supports
public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
supports
in interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validate
public void validate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
validate
in interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validateCode
protected void validateCode(org.springframework.validation.Errors errors) -
validateMaxUses
protected void validateMaxUses(OfferCode campaignCode, org.springframework.validation.Errors errors) -
validateActiveEndDate
protected void validateActiveEndDate(OfferCode campaignCode, org.springframework.validation.Errors errors)
-