Class SharedCode

  • All Implemented Interfaces:
    com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware, Serializable

    public class SharedCode
    extends Object
    implements Serializable, com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
    A simple structure that can be used to represent a code that applies an offer to an order. If a more complex structure is needed or many codes generated, use the Campaign Service.
    Author:
    Chad Harchar (charchar)
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware

        DEFAULT_FIELD_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      SharedCode()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(Object other)  
      boolean equals​(Object o)  
      String getCode()
      The code string associated to this shared code and used to apply the associated offer to an order.
      com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      int getMaxUses()
      Defines the maximum number of times that this code can be used regardless of Order or Customer.
      int hashCode()  
      void setCode​(String code)
      The code string associated to this shared code and used to apply the associated offer to an order.
      void setContextState​(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      void setMaxUses​(int maxUses)
      Defines the maximum number of times that this code can be used regardless of Order or Customer.
      String toString()  
    • Constructor Detail

      • SharedCode

        public SharedCode()
    • Method Detail

      • getCode

        public String getCode()
        The code string associated to this shared code and used to apply the associated offer to an order.
        Returns:
        The code string associated to this shared code and used to apply the associated offer to an order.
      • getMaxUses

        public int getMaxUses()
        Defines the maximum number of times that this code can be used regardless of Order or Customer. The value of 0 indicates unlimited usage.
        Returns:
        the maximum number of times that this code can be used regardless of Order or Customer.
      • getContextState

        public com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()
        A subset of Tracking information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when the ChangeDetails for the parent object's entire attributes map are compared.
        Specified by:
        getContextState in interface com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
        Returns:
        a subset of Tracking information to expose the context state for this object
      • setCode

        public void setCode​(String code)
        The code string associated to this shared code and used to apply the associated offer to an order.
        Parameters:
        code - The code string associated to this shared code and used to apply the associated offer to an order.
      • setMaxUses

        public void setMaxUses​(int maxUses)
        Defines the maximum number of times that this code can be used regardless of Order or Customer. The value of 0 indicates unlimited usage.
        Parameters:
        maxUses - the maximum number of times that this code can be used regardless of Order or Customer.
      • setContextState

        public void setContextState​(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)
        A subset of Tracking information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when the ChangeDetails for the parent object's entire attributes map are compared.
        Specified by:
        setContextState in interface com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
        Parameters:
        contextState - a subset of Tracking information to expose the context state for this object
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object