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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CodeFormatAvailableCharHelperprotected intAffects the "guessability" of codes when a code format has not been provided.voidsetAvailableCharHelper(CodeFormatAvailableCharHelper availableCharHelper) booleansupports(@NonNull Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) voidvalidate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected voidvalidateActiveEndDate(@NonNull CodeGenerator codeGenerator, @NonNull org.springframework.validation.Errors errors) protected booleanvalidateCodeFormat(@NonNull CodeGenerator codeGenerator, @NonNull org.springframework.validation.Errors errors) protected voidvalidateNumberOfCodesToGenerate(@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, waitMethods 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:
supportsin 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:
validatein 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
-