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 booleanbooleanThe 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.intThe number of uses left for this info's related shared code.intThe number of uses left for the current customer for this info's related offer.inthashCode()booleanisCanUse()If this code can be used for this offer based on it's max uses.booleanWhether this code has a maximum limit to the number of times it can be used as defined by its max uses.booleanWhether this offer has a maximum limit to the number of times it can be used by a single user.voidsetCampaignTrackingId(String campaignTrackingId) The tracking id of the campaign for which this code usability info belongs.voidsetCanUse(boolean canUse) If this code can be used for this offer based on it's max uses.voidsetHasMaxUsage(boolean hasMaxUsage) Whether this code has a maximum limit to the number of times it can be used as defined by its max uses.voidsetHasMaxUsagePerUser(boolean hasMaxUsagePerUser) Whether this offer has a maximum limit to the number of times it can be used by a single user.voidsetOfferId(String offerId) TheOfferRef.getId()of the offer to whose shared code this code usability info belongs.voidsetUsesLeft(int usesLeft) The number of uses left for this info's related shared code.voidsetUsesLeftPerCustomer(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
-