Class CodeGeneratorValidator
java.lang.Object
com.broadleafcommerce.promotion.offer.service.validation.CodeGeneratorValidator
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class CodeGeneratorValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
CodeGenerator
.- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CodeFormatAvailableCharHelper
protected int
Affects the "guessability" of codes when a code format has not been provided.void
setAvailableCharHelper
(CodeFormatAvailableCharHelper availableCharHelper) boolean
supports
(@NonNull Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
validate
(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateActiveEndDate
(@NonNull CodeGenerator codeGenerator, @NonNull org.springframework.validation.Errors errors) protected boolean
validateCodeFormat
(@NonNull CodeGenerator codeGenerator, @NonNull org.springframework.validation.Errors errors) protected void
validateNumberOfCodesToGenerate
(@NonNull CodeGenerator businessInstance, @NonNull 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
-
CodeGeneratorValidator
public CodeGeneratorValidator()
-
-
Method Details
-
supports
public boolean supports(@NonNull @NonNull @NonNull 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 @NonNull @NonNull Object businessInstance, @NonNull @NonNull @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
-
validateActiveEndDate
protected void validateActiveEndDate(@NonNull @NonNull @NonNull CodeGenerator codeGenerator, @NonNull @NonNull @NonNull org.springframework.validation.Errors errors) -
validateCodeFormat
protected boolean validateCodeFormat(@NonNull @NonNull @NonNull CodeGenerator codeGenerator, @NonNull @NonNull @NonNull org.springframework.validation.Errors errors) -
validateNumberOfCodesToGenerate
protected void validateNumberOfCodesToGenerate(@NonNull @NonNull @NonNull CodeGenerator businessInstance, @NonNull @NonNull @NonNull org.springframework.validation.Errors errors) -
getCodeMultiplier
protected int getCodeMultiplier()Affects the "guessability" of codes when a code format has not been provided. For example, if 100 codes are being generated, the default will insure that the codes are generated at least from a pool of 100000 possible codes.- Returns:
-
setAvailableCharHelper
-
getAvailableCharHelper
-