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

public class CodeUsabilityInfo extends Object implements Serializable
Contains information on a code's usability. That is, whether the code can be used or not and detailed information on the corresponding offers.
Author:
Chad Harchar (charchar), Nathan Moore (nathandmoore)
See Also:
  • Constructor Details

    • CodeUsabilityInfo

      public CodeUsabilityInfo()
  • Method Details

    • isCodeUsable

      public boolean isCodeUsable()
      Whether the related shared code's parent OfferRef has uses left.
      Returns:
      Whether the related shared code's parent OfferRef has uses left.
    • getCodeToUse

      public String getCodeToUse()
      A shared code for which this code usability tracks usage info.
      Returns:
      A shared code for which this code usability tracks usage info.
    • getCodeUsabilityType

      public String getCodeUsabilityType()
      Describes the usability of the code. This is mainly used to differentiate the different reasons a code might not be usable: It matches no offers, it's been used the maximum number times, etc.
      Returns:
      The usability of the code
      See Also:
    • getCodeUses

      public List<CodeUsage> getCodeUses()
      Infos on the uses of the related code used to determine if an offer's shared code can still be used.
      Returns:
      Infos on the uses of the related code used to determine if an offer's shared code can still be used.
    • setCodeToUse

      public void setCodeToUse(String codeToUse)
      A shared code for which this code usability tracks usage info.
      Parameters:
      codeToUse - A shared code for which this code usability tracks usage info.
    • setCodeUsabilityType

      public void setCodeUsabilityType(String codeUsabilityType)
      Describes the usability of the code. This is mainly used to differentiate the different reasons a code might not be usable: It matches no offers, it's been used the maximum number times, etc.
      Parameters:
      codeUsabilityType - The usability of the code
      See Also:
    • setCodeUses

      public void setCodeUses(List<CodeUsage> codeUses)
      Infos on the uses of the related code used to determine if an offer's shared code can still be used.
      Parameters:
      codeUses - Infos on the uses of the related code used to determine if an offer's shared code can still be used.
    • 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