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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Defines the ending time for which this offer code is active.Defines the beginning time for which this offer code is active.<T> T
getAttribute
(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.ContextState
A subset ofTracking
information 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()
int
Defines the number of max uses allowed for this offer code.int
Determines 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.int
hashCode()
boolean
Defines whether this code has been assigned for use.boolean
boolean
void
setActiveEndDate
(Instant activeEndDate) Defines the ending time for which this offer code is active.void
setActiveStartDate
(Instant activeStartDate) Defines the beginning time for which this offer code is active.void
setAssigned
(boolean assigned) Defines whether this code has been assigned for use.void
setAttributes
(Map<String, Attribute> attributes) Dynamic attributes that are a part of the offer code.void
setCampaignId
(String campaignId) Defines the id for the campaign that originated the offer code.void
The string code that represents this record.void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setEmailRegEx
(String emailRegEx) Defines a regex to be used for validating the offer code for customer updateUses.void
setExternalId
(String externalId) This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.void
setGeneralMaxUsageStatus
(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
.void
setGeneratorId
(String generatorId) Defines the id for the code generator that originated the offer code.void
void
setMaxUses
(int maxUses) Defines the number of max uses allowed for this offer code.void
setMaxUsesPerUser
(int maxUsesPerUser) Determines the maximum number of times this offer code can be used by the same user.void
setOfferId
(String offerId) Defines the id for the offer that originated the offer code.void
setSegment
(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, wait
Methods 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:
getActiveStartDate
in 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:
getActiveEndDate
in 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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information 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.VIABLE
when 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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-