Class CodeUsage
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.CodeUsage
- All Implemented Interfaces:
Serializable
Information on a
CodeUsabilityInfo.getCodeToUse()
usage for a related offer.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The tracking id of the campaign for which this code usability info belongs.TheOfferRef.getId()
of the offer to whose shared code this code usability info belongs.int
The number of uses left for this info's related shared code.int
The number of uses left for the current customer for this info's related offer.int
hashCode()
boolean
isCanUse()
If this code can be used for this offer based on it's max uses.boolean
Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.boolean
Whether this offer has a maximum limit to the number of times it can be used by a single user.void
setCampaignTrackingId
(String campaignTrackingId) The tracking id of the campaign for which this code usability info belongs.void
setCanUse
(boolean canUse) If this code can be used for this offer based on it's max uses.void
setHasMaxUsage
(boolean hasMaxUsage) Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.void
setHasMaxUsagePerUser
(boolean hasMaxUsagePerUser) Whether this offer has a maximum limit to the number of times it can be used by a single user.void
setOfferId
(String offerId) TheOfferRef.getId()
of the offer to whose shared code this code usability info belongs.void
setUsesLeft
(int usesLeft) The number of uses left for this info's related shared code.void
setUsesLeftPerCustomer
(int usesLeftPerCustomer) The number of uses left for the current customer for this info's related offer.toString()
-
Constructor Details
-
CodeUsage
public CodeUsage()
-
-
Method Details
-
getOfferId
TheOfferRef.getId()
of the offer to whose shared code this code usability info belongs.- Returns:
- The
OfferRef.getId()
of the offer to whose shared code this code usability info belongs.
-
getCampaignTrackingId
The tracking id of the campaign for which this code usability info belongs.- Returns:
- The tracking id of the campaign for which this code usability info belongs.
-
isCanUse
public boolean isCanUse()If this code can be used for this offer based on it's max uses.- Returns:
- If this code can be used for this offer based on it's max uses.
-
isHasMaxUsage
public boolean isHasMaxUsage()Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.- Returns:
- Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.
-
getUsesLeft
public int getUsesLeft()The number of uses left for this info's related shared code. This is calculated by subtracting the number of times the code has been used from its max uses.- Returns:
- The number of uses left for this info's related shared code.
-
isHasMaxUsagePerUser
public boolean isHasMaxUsagePerUser()Whether this offer has a maximum limit to the number of times it can be used by a single user.- Returns:
- Whether this offer has a maximum limit to the number of times it can be used by a single user.
-
getUsesLeftPerCustomer
public int getUsesLeftPerCustomer()The number of uses left for the current customer for this info's related offer. This is calculated by subtracting the number of times the offer code has been used by the customer from its max uses per customer.- Returns:
- The number of uses left for the current customer for this info's related offer code.
-
setOfferId
TheOfferRef.getId()
of the offer to whose shared code this code usability info belongs.- Parameters:
offerId
- TheOfferRef.getId()
of the offer to whose shared code this code usability info belongs.
-
setCampaignTrackingId
The tracking id of the campaign for which this code usability info belongs.- Parameters:
campaignTrackingId
- The tracking id of the campaign for which this code usability info belongs.
-
setCanUse
public void setCanUse(boolean canUse) If this code can be used for this offer based on it's max uses.- Parameters:
canUse
- If this code can be used for this offer based on it's max uses.
-
setHasMaxUsage
public void setHasMaxUsage(boolean hasMaxUsage) Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.- Parameters:
hasMaxUsage
- Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.
-
setUsesLeft
public void setUsesLeft(int usesLeft) The number of uses left for this info's related shared code. This is calculated by subtracting the number of times the code has been used from its max uses.- Parameters:
usesLeft
- The number of uses left for this info's related shared code.
-
setHasMaxUsagePerUser
public void setHasMaxUsagePerUser(boolean hasMaxUsagePerUser) Whether this offer has a maximum limit to the number of times it can be used by a single user.- Parameters:
hasMaxUsagePerUser
- Whether this offer has a maximum limit to the number of times it can be used by a single user.
-
setUsesLeftPerCustomer
public void setUsesLeftPerCustomer(int usesLeftPerCustomer) The number of uses left for the current customer for this info's related offer. This is calculated by subtracting the number of times the offer code has been used by the customer from its max uses per customer.- Parameters:
usesLeftPerCustomer
- The number of uses left for the current customer for this info's related offer code.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-