Class AttributeChoiceValue

java.lang.Object
com.broadleafcommerce.cartoperation.domain.AttributeChoiceValue
All Implemented Interfaces:
Serializable

public class AttributeChoiceValue extends Object implements Serializable
A single value within a AttributeChoice.
Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • AttributeChoiceValue

      public AttributeChoiceValue()
    • AttributeChoiceValue

      public AttributeChoiceValue(String label, String value, Map<String,Object> attributes)
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> getAttribute()
      Return any additional attributes passed in the request not matching any defined properties.
      Returns:
      any additional attributes passed in the request not matching any defined properties.
    • getLabel

      public String getLabel()
      What the customer sees for display. For example, text in the case of sizes or a hex value in the case of colors. Can diverge from value which is what is added to the cart
      Returns:
      the customer-facing display. If null, the getValue() should be used for display
    • getValue

      public String getValue()
      The value stored as an item attribute or cart attribute based on what the user selects.
      Returns:
      the value that should be stored as an item/cart attribute when the user selects this choice
    • getAttributes

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setLabel

      public void setLabel(String label)
      What the customer sees for display. For example, text in the case of sizes or a hex value in the case of colors. Can diverge from value which is what is added to the cart
      Parameters:
      label - customer-facing display of this value
    • setValue

      public void setValue(String value)
      The value stored as an item attribute or cart attribute based on what the user selects.
      Parameters:
      value - what will be stored as an item/cart attribute
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • 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