Class OfferCodeGenerationInfoImpl
java.lang.Object
com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfoImpl
- All Implemented Interfaces:
OfferCodeGenerationInfo,OfferCodeGenerationInfoAdminPresentation,Serializable,org.broadleafcommerce.common.admin.domain.AdminMainEntity,org.broadleafcommerce.common.copy.MultiTenantCloneable<OfferCodeGenerationInfo>
@Entity
public class OfferCodeGenerationInfoImpl
extends Object
implements OfferCodeGenerationInfo, org.broadleafcommerce.common.admin.domain.AdminMainEntity, OfferCodeGenerationInfoAdminPresentation
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.broadleafcommerce.advancedoffer.codes.domain.OfferCodeGenerationInfoAdminPresentation
OfferCodeGenerationInfoAdminPresentation.GroupName, OfferCodeGenerationInfoAdminPresentation.GroupOrder, OfferCodeGenerationInfoAdminPresentation.TabName, OfferCodeGenerationInfoAdminPresentation.TabOrder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Dateprotected List<OfferCodeGenerationAdditionalOfferXref>protected Dateprotected Stringprotected Dateprotected List<org.broadleafcommerce.core.offer.domain.OfferCode>protected DateFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends OfferCodeGenerationInfo>
org.broadleafcommerce.common.copy.CreateResponse<G>createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) booleanReturns the Active Start Date for a code group that is used if an offer code does not have an Active DateReturns the additional offers that are associated to this generator.Returns the custom formatter for generating codes.Returns the CodeGenerationType being used to generate offer codes.Returns a String withOfferCodeGenerationInfo.getNumberOfCodesGenerated()/#getNumberOfCodesRequested()If those values = just returnsOfferCodeGenerationInfo.getNumberOfCodesGenerated()Returns the CodeGenerationType being used to generate offer codes.Returns the length of the code the generator should generated (not including the length of the prefix).Returns the code prefix the generator should use to prepend to any generated offer code.Return date this generator was created.Returns the descriptionReturns the EmailRegEx used to validate an offerCodeReturns the End Date for a code group that is used if an offer code does not have an End DategetId()Returns the unique idbooleanIf set, allows codes to be generated that might be easily guessed.Returns the maximum number of uses to set for each code generated.intReturns the number of codes actually generated by this code generator.Number of codes that should be generated.org.broadleafcommerce.core.offer.domain.OffergetOffer()Returns the associated offer for which codes are being generated.List<org.broadleafcommerce.core.offer.domain.OfferCode>Returns the offer codes that were created as part of this generator.Return date this generator was last updated.inthashCode()voidsetActiveStartDate(Date activeStartDate) Set the Active Start Date for a code group that is used if an offer code does not have an Active DatevoidsetAdditionalOffers(List<OfferCodeGenerationAdditionalOfferXref> additionalOffers) Sets additional offers that are associated to this generator.voidsetCodeFormat(String codeFormat) Sets a custom formatter for generating codes.voidsetCodeGenerationMethod(CodeGenerationMethodType codeGenerationMethod) Sets the CodeGenerationType being used to generate offer codes.voidsetCodeGenerationProgressMessage(String codeGenerationMessage) voidsetCodeGenerationStatus(CodeGenerationStatusType codeGenerationStatus) Sets the CodeGenerationStatusType being used to generate offer codes.voidsetCodeLength(Integer codeLength) Sets the code length the generator should use when generating the codes.voidsetCodePrefix(String codePrefix) Sets the codePrefixvoidsetCreateDate(Date createDate) Set the date this generator was created.voidsetDescription(String description) Sets the descriptionvoidsetEmailRegEx(String emailRegEx) Sets EmailRegEx that is used to validate offerCodesvoidsetEndDate(Date endDate) Set the End Date for a code group that is used if an offer code does not have an End DatevoidSets the idvoidsetIgnoreGuessabilityError(boolean ignoreGuessabilityError) Sets the system to ignore guessability warning.voidsetMaxUses(Integer maxUses) Sets the maximum number of orders that the code can be used in.voidsetNumberOfCodesGenerated(Integer numberOfCodesGenerated) Sets the number of codes to generate.voidsetNumberOfCodesToGenerate(Integer numberOfCodesToGenerate) The maximum amount of OfferCodes that can be generated is set by the system property offerCode.maxCodeGeneration.voidsetOffer(org.broadleafcommerce.core.offer.domain.Offer offer) Sets the associated offer for which codes are being generated.voidsetOfferCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodes) Sets the offer codes that can be used to retrieve this Offer.voidsetUpdateDate(Date updateDate) Set the date this generator was last updated.
-
Field Details
-
additionalOffers
-
createDate
-
updateDate
-
offerCodes
-
emailRegEx
-
activeStartDate
-
endDate
-
-
Constructor Details
-
OfferCodeGenerationInfoImpl
public OfferCodeGenerationInfoImpl()
-
-
Method Details
-
getId
Description copied from interface:OfferCodeGenerationInfoReturns the unique id- Specified by:
getIdin interfaceOfferCodeGenerationInfo- Returns:
-
setId
Description copied from interface:OfferCodeGenerationInfoSets the id- Specified by:
setIdin interfaceOfferCodeGenerationInfo
-
getDescription
Description copied from interface:OfferCodeGenerationInfoReturns the description- Specified by:
getDescriptionin interfaceOfferCodeGenerationInfo- Returns:
-
setDescription
Description copied from interface:OfferCodeGenerationInfoSets the description- Specified by:
setDescriptionin interfaceOfferCodeGenerationInfo
-
getNumberOfCodesToGenerate
Description copied from interface:OfferCodeGenerationInfoNumber of codes that should be generated. Required.- Specified by:
getNumberOfCodesToGeneratein interfaceOfferCodeGenerationInfo- Returns:
-
setNumberOfCodesToGenerate
The maximum amount of OfferCodes that can be generated is set by the system property offerCode.maxCodeGeneration. The default value for maximum code generation is 100,000- Specified by:
setNumberOfCodesToGeneratein interfaceOfferCodeGenerationInfo- Parameters:
numberOfCodesToGenerate-
-
getNumberOfCodesGenerated
public int getNumberOfCodesGenerated()Description copied from interface:OfferCodeGenerationInfoReturns the number of codes actually generated by this code generator.- Specified by:
getNumberOfCodesGeneratedin interfaceOfferCodeGenerationInfo- Returns:
-
setNumberOfCodesGenerated
Description copied from interface:OfferCodeGenerationInfoSets the number of codes to generate.- Specified by:
setNumberOfCodesGeneratedin interfaceOfferCodeGenerationInfo
-
getOffer
public org.broadleafcommerce.core.offer.domain.Offer getOffer()Description copied from interface:OfferCodeGenerationInfoReturns the associated offer for which codes are being generated.- Specified by:
getOfferin interfaceOfferCodeGenerationInfo- Returns:
-
setOffer
public void setOffer(org.broadleafcommerce.core.offer.domain.Offer offer) Description copied from interface:OfferCodeGenerationInfoSets the associated offer for which codes are being generated.- Specified by:
setOfferin interfaceOfferCodeGenerationInfo
-
getCodeFormat
Description copied from interface:OfferCodeGenerationInfoReturns the custom formatter for generating codes. Customer formatters allow for precise control of the code format.This setting is used only for
CodeGenerationMethodType.SPECIFY_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)
- Specified by:
getCodeFormatin interfaceOfferCodeGenerationInfo- Returns:
- See Also:
-
setCodeFormat
Description copied from interface:OfferCodeGenerationInfoSets a custom formatter for generating codes.- Specified by:
setCodeFormatin interfaceOfferCodeGenerationInfo- See Also:
-
getCodePrefix
Description copied from interface:OfferCodeGenerationInfoReturns the code prefix the generator should use to prepend to any generated offer code. All codes will be prepended with this prefix.This setting is ignored for
CodeGenerationMethodType.SPECIFY_FORMAT.- Specified by:
getCodePrefixin interfaceOfferCodeGenerationInfo- Returns:
-
setCodePrefix
Description copied from interface:OfferCodeGenerationInfoSets the codePrefix- Specified by:
setCodePrefixin interfaceOfferCodeGenerationInfo- See Also:
-
getCodeLength
Description copied from interface:OfferCodeGenerationInfoReturns the length of the code the generator should generated (not including the length of the prefix).This setting is used only for
CodeGenerationMethodType.SPECIFY_LENGTH.- Specified by:
getCodeLengthin interfaceOfferCodeGenerationInfo- Returns:
-
setCodeLength
Description copied from interface:OfferCodeGenerationInfoSets the code length the generator should use when generating the codes.- Specified by:
setCodeLengthin interfaceOfferCodeGenerationInfo- See Also:
-
getMaxUses
Description copied from interface:OfferCodeGenerationInfoReturns the maximum number of uses to set for each code generated.- Specified by:
getMaxUsesin interfaceOfferCodeGenerationInfo- Returns:
-
setMaxUses
Description copied from interface:OfferCodeGenerationInfoSets the maximum number of orders that the code can be used in. Use in conjunction withOffer.getMaxUsesPerOrder()to limit the number of times the offer can be used within the same order.- Specified by:
setMaxUsesin interfaceOfferCodeGenerationInfo- See Also:
-
getCodeGenerationStatus
Description copied from interface:OfferCodeGenerationInfoReturns the CodeGenerationType being used to generate offer codes.- Specified by:
getCodeGenerationStatusin interfaceOfferCodeGenerationInfo
-
setCodeGenerationStatus
Description copied from interface:OfferCodeGenerationInfoSets the CodeGenerationStatusType being used to generate offer codes.- Specified by:
setCodeGenerationStatusin interfaceOfferCodeGenerationInfo
-
getCodeGenerationMethod
Description copied from interface:OfferCodeGenerationInfoReturns the CodeGenerationType being used to generate offer codes.- Specified by:
getCodeGenerationMethodin interfaceOfferCodeGenerationInfo
-
setCodeGenerationMethod
Description copied from interface:OfferCodeGenerationInfoSets the CodeGenerationType being used to generate offer codes.- Specified by:
setCodeGenerationMethodin interfaceOfferCodeGenerationInfo
-
getIgnoreGuessabilityError
public boolean getIgnoreGuessabilityError()Description copied from interface:OfferCodeGenerationInfoIf set, allows codes to be generated that might be easily guessed. System code generation is likely to fail for this mode when using random code generation as it will produce an excessive amount of collisions and fail.- Specified by:
getIgnoreGuessabilityErrorin interfaceOfferCodeGenerationInfo- Returns:
-
setIgnoreGuessabilityError
public void setIgnoreGuessabilityError(boolean ignoreGuessabilityError) Description copied from interface:OfferCodeGenerationInfoSets the system to ignore guessability warning.- Specified by:
setIgnoreGuessabilityErrorin interfaceOfferCodeGenerationInfo
-
getCreateDate
Description copied from interface:OfferCodeGenerationInfoReturn date this generator was created.- Specified by:
getCreateDatein interfaceOfferCodeGenerationInfo- Returns:
-
setCreateDate
Description copied from interface:OfferCodeGenerationInfoSet the date this generator was created.- Specified by:
setCreateDatein interfaceOfferCodeGenerationInfo
-
getUpdateDate
Description copied from interface:OfferCodeGenerationInfoReturn date this generator was last updated.- Specified by:
getUpdateDatein interfaceOfferCodeGenerationInfo- Returns:
-
setUpdateDate
Description copied from interface:OfferCodeGenerationInfoSet the date this generator was last updated.- Specified by:
setUpdateDatein interfaceOfferCodeGenerationInfo
-
getCodeGenerationProgressMessage
Description copied from interface:OfferCodeGenerationInfoReturns a String withOfferCodeGenerationInfo.getNumberOfCodesGenerated()/#getNumberOfCodesRequested()If those values = just returnsOfferCodeGenerationInfo.getNumberOfCodesGenerated()Gives the admin an easy way to return progress. This field is automatically updated when setCod
- Specified by:
getCodeGenerationProgressMessagein interfaceOfferCodeGenerationInfo- Returns:
-
setCodeGenerationProgressMessage
- Specified by:
setCodeGenerationProgressMessagein interfaceOfferCodeGenerationInfo- See Also:
-
getOfferCodes
Description copied from interface:OfferCodeGenerationInfoReturns the offer codes that were created as part of this generator.- Specified by:
getOfferCodesin interfaceOfferCodeGenerationInfo- Returns:
-
setOfferCodes
Description copied from interface:OfferCodeGenerationInfoSets the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered- Specified by:
setOfferCodesin interfaceOfferCodeGenerationInfo
-
getAdditionalOffers
Description copied from interface:OfferCodeGenerationInfoReturns the additional offers that are associated to this generator.- Specified by:
getAdditionalOffersin interfaceOfferCodeGenerationInfo- Returns:
-
setAdditionalOffers
Description copied from interface:OfferCodeGenerationInfoSets additional offers that are associated to this generator. These offers will also be applied to an order whenever one of the associated codes is used.- Specified by:
setAdditionalOffersin interfaceOfferCodeGenerationInfo
-
getEmailRegEx
Description copied from interface:OfferCodeGenerationInfoReturns the EmailRegEx used to validate an offerCode- Specified by:
getEmailRegExin interfaceOfferCodeGenerationInfo- Returns:
-
setEmailRegEx
Description copied from interface:OfferCodeGenerationInfoSets EmailRegEx that is used to validate offerCodes- Specified by:
setEmailRegExin interfaceOfferCodeGenerationInfo
-
getActiveStartDate
Description copied from interface:OfferCodeGenerationInfoReturns the Active Start Date for a code group that is used if an offer code does not have an Active Date- Specified by:
getActiveStartDatein interfaceOfferCodeGenerationInfo
-
setActiveStartDate
Description copied from interface:OfferCodeGenerationInfoSet the Active Start Date for a code group that is used if an offer code does not have an Active Date- Specified by:
setActiveStartDatein interfaceOfferCodeGenerationInfo
-
getEndDate
Description copied from interface:OfferCodeGenerationInfoReturns the End Date for a code group that is used if an offer code does not have an End Date- Specified by:
getEndDatein interfaceOfferCodeGenerationInfo
-
setEndDate
Description copied from interface:OfferCodeGenerationInfoSet the End Date for a code group that is used if an offer code does not have an End Date- Specified by:
setEndDatein interfaceOfferCodeGenerationInfo
-
createOrRetrieveCopyInstance
public <G extends OfferCodeGenerationInfo> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException - Specified by:
createOrRetrieveCopyInstancein interfaceorg.broadleafcommerce.common.copy.MultiTenantCloneable<OfferCodeGenerationInfo>- Throws:
CloneNotSupportedException
-
equals
-
hashCode
public int hashCode() -
getMainEntityName
- Specified by:
getMainEntityNamein interfaceorg.broadleafcommerce.common.admin.domain.AdminMainEntity
-