java.lang.Object
com.broadleafcommerce.promotion.campaign.client.web.context.CampaignCodeUsage
All Implemented Interfaces:
Serializable

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

    Constructors
    Constructor
    Description
     
    CampaignCodeUsage(String campaignTrackingId, boolean canUse, boolean hasMaxUsage, int usesLeft)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    The tracking id of the campaign for which this code usability info belongs.
    int
    The number of uses left for this info's related campaign code.
    int
     
    boolean
    If this code can be used for the campaign 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 it's max uses.
    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 the campaign 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 it's max uses.
    void
    setUsesLeft(int usesLeft)
    The number of uses left for this info's related campaign code.
     

    Methods inherited from class java.lang.Object

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

    • CampaignCodeUsage

      public CampaignCodeUsage()
    • CampaignCodeUsage

      public CampaignCodeUsage(String campaignTrackingId, boolean canUse, boolean hasMaxUsage, int usesLeft)
  • Method Details

    • 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 the campaign based on it's max uses.
      Returns:
      If this code can be used for the campaign 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 it's max uses.
      Returns:
      Whether this code has a maximum limit to the number of times it can be used as defined by it's max uses.
    • getUsesLeft

      public int getUsesLeft()
      The number of uses left for this info's related campaign code. This is calculated by subtracting the number of times the code has been used from it's max uses.
      Returns:
      The number of uses left for this info's related campaign code.
    • 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 the campaign based on it's max uses.
      Parameters:
      canUse - If this code can be used for the campaign 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 it's max uses.
      Parameters:
      hasMaxUsage - Whether this code has a maximum limit to the number of times it can be used as defined by it's max uses.
    • setUsesLeft

      public void setUsesLeft(int usesLeft)
      The number of uses left for this info's related campaign code. This is calculated by subtracting the number of times the code has been used from it's max uses.
      Parameters:
      usesLeft - The number of uses left for this info's related campaign 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