Class CodeGeneratorValidator
- java.lang.Object
-
- com.broadleafcommerce.promotion.campaign.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 forCodeGenerator
.- Author:
- Samarth Dhruva (samarthd)
- See Also:
CodeGeneratorPreValidator
-
-
Constructor Summary
Constructors Constructor Description CodeGeneratorValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CodeFormatAvailableCharHelper
getAvailableCharHelper()
protected int
getCodeMultiplier()
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)
-
-
-
Method Detail
-
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
@Autowired public void setAvailableCharHelper(CodeFormatAvailableCharHelper availableCharHelper)
-
getAvailableCharHelper
@NonNull protected CodeFormatAvailableCharHelper getAvailableCharHelper()
-
-