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

public class Attribute extends Object implements Serializable
Many entities have customizable dynamic attributes, and this class is intended to hold such values.

Attributes are placed on domain objects as a map of attribute names to attribute values: Map<String, Attribute>.

Author:
Chad Harchar, Samarth Dhruva
See Also:
  • Constructor Details

  • 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.
    • getValue

      public Serializable getValue()
      The value represented by this attribute. Attributes are generally placed on domain objects as a map of attribute names to attribute values: Map<String, Attribute>.
      Returns:
      the value represented by this attribute
    • getAttributes

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

      public void setValue(Serializable value)
      The value represented by this attribute. Attributes are generally placed on domain objects as a map of attribute names to attribute values: Map<String, Attribute>.
      Parameters:
      value - the value represented by this 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