Class OfferCode
java.lang.Object
com.broadleafcommerce.promotion.offer.domain.OfferCode
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,ActiveDateEntity,Serializable
public class OfferCode
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware, ActiveDateEntity
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDefines the ending time for which this offer code is active.Defines the beginning time for which this offer code is active.<T> TgetAttribute(String name) Dynamic attributes that are a part of the offer code.Defines the id for the campaign that originated the offer code.getCode()The string code that represents this record.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.Defines a regex to be used for validating the offer code for customer updateUses.This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.Defines the id for the code generator that originated the offer code.getId()intDefines the number of max uses allowed for this offer code.intDetermines the maximum number of times this offer code can be used by the same user.Defines the id for the offer that originated the offer code.The segment to which this offer can apply.inthashCode()booleanDefines whether this code has been assigned for use.booleanbooleanvoidsetActiveEndDate(Instant activeEndDate) Defines the ending time for which this offer code is active.voidsetActiveStartDate(Instant activeStartDate) Defines the beginning time for which this offer code is active.voidsetAssigned(boolean assigned) Defines whether this code has been assigned for use.voidsetAttributes(Map<String, Attribute> attributes) Dynamic attributes that are a part of the offer code.voidsetCampaignId(String campaignId) Defines the id for the campaign that originated the offer code.voidThe string code that represents this record.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetEmailRegEx(String emailRegEx) Defines a regex to be used for validating the offer code for customer updateUses.voidsetExternalId(String externalId) This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.voidsetGeneralMaxUsageStatus(String generalMaxUsageStatus) If an offercode has been deemed to have exceeded its max usage threshold, this field will be set with a reasonMaxUsageStatusType.MAX_USES_EXCEEDED.voidsetGeneratorId(String generatorId) Defines the id for the code generator that originated the offer code.voidvoidsetMaxUses(int maxUses) Defines the number of max uses allowed for this offer code.voidsetMaxUsesPerUser(int maxUsesPerUser) Determines the maximum number of times this offer code can be used by the same user.voidsetOfferId(String offerId) Defines the id for the offer that originated the offer code.voidsetSegment(String segment) The segment to which this offer can apply.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.broadleafcommerce.promotion.offer.domain.ActiveDateEntity
checkActiveDates, checkActiveDates
-
Constructor Details
-
OfferCode
public OfferCode()
-
-
Method Details
-
getAttribute
-
isCampaignCode
public boolean isCampaignCode() -
getGeneralMaxUsageStatus
-
getId
-
getCode
The string code that represents this record. -
getExternalId
This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.- Returns:
- an external ID
-
getOfferId
Defines the id for the offer that originated the offer code. -
getActiveStartDate
Defines the beginning time for which this offer code is active.- Specified by:
getActiveStartDatein interfaceActiveDateEntity- Returns:
- The time at which this entity becomes active for storefront consumption
-
getActiveEndDate
Defines the ending time for which this offer code is active.- Specified by:
getActiveEndDatein interfaceActiveDateEntity- Returns:
- The time at which this entity becomes inactive for storefront consumption
-
getMaxUses
public int getMaxUses()Defines the number of max uses allowed for this offer code. By default, a code can be used only once. -
getMaxUsesPerUser
public int getMaxUsesPerUser()Determines the maximum number of times this offer code can be used by the same user. A value of 0 indicates unlimited usage. Default is 0. -
getEmailRegEx
Defines a regex to be used for validating the offer code for customer updateUses. -
getCampaignId
Defines the id for the campaign that originated the offer code. -
getGeneratorId
Defines the id for the code generator that originated the offer code. -
isAssigned
public boolean isAssigned()Defines whether this code has been assigned for use. -
getSegment
The segment to which this offer can apply. A value of empty or "ANY" is the most common usage and means that this offer can apply to any qualifying part of the order. Typical uses of segments include using them to restrict an offer to a specific vendor or store (aka banner).- Returns:
- The segment to which this offer can apply.
-
getAttributes
Dynamic attributes that are a part of the offer code.- Returns:
- dynamic attributes that are a part of the offer code
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setId
-
setCode
The string code that represents this record. -
setExternalId
This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.- Parameters:
externalId- an external ID, often a DB or business ID, from a system outside of Broadleaf
-
setOfferId
Defines the id for the offer that originated the offer code. -
setActiveStartDate
Defines the beginning time for which this offer code is active. -
setActiveEndDate
Defines the ending time for which this offer code is active. -
setMaxUses
public void setMaxUses(int maxUses) Defines the number of max uses allowed for this offer code. By default, a code can be used only once. -
setMaxUsesPerUser
public void setMaxUsesPerUser(int maxUsesPerUser) Determines the maximum number of times this offer code can be used by the same user. A value of 0 indicates unlimited usage. Default is 0. -
setGeneralMaxUsageStatus
If an offercode has been deemed to have exceeded its max usage threshold, this field will be set with a reasonMaxUsageStatusType.MAX_USES_EXCEEDED. This reason applies to general offercode usage as specified bygetMaxUses(). Exceeding max thresholds for specific users scenarios is not tracked here. Status will beMaxUsageStatusType.VIABLEwhen the offercode has not exceeded thresholds yet, or is not bound by max usage thresholds. -
setEmailRegEx
Defines a regex to be used for validating the offer code for customer updateUses. -
setCampaignId
Defines the id for the campaign that originated the offer code. -
setGeneratorId
Defines the id for the code generator that originated the offer code. -
setAssigned
public void setAssigned(boolean assigned) Defines whether this code has been assigned for use. -
setSegment
The segment to which this offer can apply. A value of empty or "ANY" is the most common usage and means that this offer can apply to any qualifying part of the order. Typical uses of segments include using them to restrict an offer to a specific vendor or store (aka banner). -
setAttributes
Dynamic attributes that are a part of the offer code.- Parameters:
attributes- dynamic attributes that are a part of the offer code
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-