Class CodeGenerator
java.lang.Object
com.broadleafcommerce.orderoperation.domain.CodeGenerator
- All Implemented Interfaces:
Serializable
- Author:
- Chad Harchar (charchar)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Instant
Sets the Active End Date for codes generated by this generator.protected Instant
Sets the Active Start Date for codes generated by this generator.protected String
Provides a customer email validation when the generated codes are requested for use. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Sets the Active End Date for codes generated by this generator.Sets the Active Start Date for codes generated by this generator.Defines the id for the campaign that originated this code generator.The custom formatter for generating codes.The code length the generator should use when generating the codes.Defines a prefix to updateUses when generating campaign codes for this campaign.Provides a customer email validation when the generated codes are requested for use.getId()
int
The maximum number of uses to set for each code generated.int
The number of codes that will be generatedint
hashCode()
void
setActiveEndDate
(Instant activeEndDate) Sets the Active End Date for codes generated by this generator.void
setActiveStartDate
(Instant activeStartDate) Sets the Active Start Date for codes generated by this generator.void
setCampaignId
(String campaignId) Defines the id for the campaign that originated this code generator.void
setCodeFormat
(String codeFormat) The custom formatter for generating codes.void
setCodeLength
(Integer codeLength) The code length the generator should use when generating the codes.void
setCodePrefix
(String codePrefix) Defines a prefix to updateUses when generating campaign codes for this campaign.void
setEmailRegEx
(String emailRegEx) Provides a customer email validation when the generated codes are requested for use.void
void
setMaxUses
(int maxUses) The maximum number of uses to set for each code generated.void
setNumberOfCodesToGenerate
(int numberOfCodesToGenerate) The number of codes that will be generatedtoString()
-
Field Details
-
emailRegEx
Provides a customer email validation when the generated codes are requested for use. -
activeStartDate
Sets the Active Start Date for codes generated by this generator. -
activeEndDate
Sets the Active End Date for codes generated by this generator.
-
-
Constructor Details
-
CodeGenerator
public CodeGenerator()
-
-
Method Details
-
getId
-
getCodePrefix
Defines a prefix to updateUses when generating campaign codes for this campaign. This will default toCampaign#codePrefix
, if not set. This is intended to be used as an override, if required. -
getNumberOfCodesToGenerate
public int getNumberOfCodesToGenerate()The number of codes that will be generated -
getCodeFormat
The custom formatter for generating codes. Customer formatters allow for precise control of the code format. For example, consider "CF-##-@@-**-1" which might generate the following code "CF-99-AB-Z3-1". Each symbol is processed by the CodeGenerator. The default implementation is as follows: # is replaced by a random number (not including 0, 1, or 5) @ is replaced by a random character (not including 0, L, or S) * is replaced by random alphanumeric character (not including those mentioned above).- Returns:
- See Also:
-
com.broadleafcommerce.promotion.campaign.service.DefaultCampaignCodeService
-
getCodeLength
The code length the generator should use when generating the codes. -
getMaxUses
public int getMaxUses()The maximum number of uses to set for each code generated. -
getEmailRegEx
Provides a customer email validation when the generated codes are requested for use. -
getActiveStartDate
Sets the Active Start Date for codes generated by this generator. -
getActiveEndDate
Sets the Active End Date for codes generated by this generator. -
getCampaignId
Defines the id for the campaign that originated this code generator. -
setId
-
setCodePrefix
Defines a prefix to updateUses when generating campaign codes for this campaign. This will default toCampaign#codePrefix
, if not set. This is intended to be used as an override, if required. -
setNumberOfCodesToGenerate
public void setNumberOfCodesToGenerate(int numberOfCodesToGenerate) The number of codes that will be generated -
setCodeFormat
The custom formatter for generating codes. Customer formatters allow for precise control of the code format. For example, consider "CF-##-@@-**-1" which might generate the following code "CF-99-AB-Z3-1". Each symbol is processed by the CodeGenerator. The default implementation is as follows: # is replaced by a random number (not including 0, 1, or 5) @ is replaced by a random character (not including 0, L, or S) * is replaced by random alphanumeric character (not including those mentioned above).- See Also:
-
com.broadleafcommerce.promotion.campaign.service.DefaultCampaignCodeService
-
setCodeLength
The code length the generator should use when generating the codes. -
setMaxUses
public void setMaxUses(int maxUses) The maximum number of uses to set for each code generated. -
setEmailRegEx
Provides a customer email validation when the generated codes are requested for use. -
setActiveStartDate
Sets the Active Start Date for codes generated by this generator. -
setActiveEndDate
Sets the Active End Date for codes generated by this generator. -
setCampaignId
Defines the id for the campaign that originated this code generator. -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-