java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.CodeUsage
All Implemented Interfaces:
Serializable

public class CodeUsage extends Object implements Serializable
Information on a CodeUsabilityInfo.getCodeToUse() usage for a related offer.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    The tracking id of the campaign for which this code usability info belongs.
    The OfferRef.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
     
    boolean
    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)
    The OfferRef.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.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CodeUsage

      public CodeUsage()
  • Method Details

    • getOfferId

      public String getOfferId()
      The OfferRef.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

      public String 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

      public void setOfferId(String offerId)
      The OfferRef.getId() of the offer to whose shared code this code usability info belongs.
      Parameters:
      offerId - The OfferRef.getId() of the offer to whose shared code this code usability info belongs.
    • setCampaignTrackingId

      public void setCampaignTrackingId(String campaignTrackingId)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object