Class OfferUsabilityInfo
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.OfferUsabilityInfo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
int
The number of uses left for this info's related offer.int
The number of uses left for the current customer for this info's related offer.int
hashCode()
boolean
isCanUse()
If this offer can be used based on its max uses.boolean
Whether this offer 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
setCanUse
(boolean canUse) If this offer can be used based on its max uses.void
setHasMaxUsage
(boolean hasMaxUsage) Whether this offer 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) void
setUsesLeft
(int usesLeft) The number of uses left for this info's related offer.void
setUsesLeftPerCustomer
(int usesLeftPerCustomer) The number of uses left for the current customer for this info's related offer.toString()
-
Constructor Details
-
OfferUsabilityInfo
public OfferUsabilityInfo()
-
-
Method Details
-
getOfferId
-
isCanUse
public boolean isCanUse()If this offer can be used based on its max uses.- Returns:
- If this code can be used for this offer based on it's max uses.
-
isHasMaxUsage
public boolean isHasMaxUsage()Whether this offer has a maximum limit to the number of times it can be used as defined by its max uses.- Returns:
- Whether this offer 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 offer. This is calculated by subtracting the number of times the offer has been used from its max uses.- Returns:
- The number of uses left for this info's related offer.
-
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 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.
-
setOfferId
-
setCanUse
public void setCanUse(boolean canUse) If this offer can be used based on its 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 offer has a maximum limit to the number of times it can be used as defined by its max uses.- Parameters:
hasMaxUsage
- Whether this offer 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 offer. This is calculated by subtracting the number of times the offer has been used from its max uses.- Parameters:
usesLeft
- The number of uses left for this info's related offer.
-
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 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.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-