Class Attribute
- 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:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(String name, Object value)
Takes in any additional attributes passed in the request not matching any defined properties.protected boolean
canEqual(Object other)
boolean
equals(Object o)
Map<String,Object>
getAttribute()
Return any additional attributes passed in the request not matching any defined properties.Map<String,Object>
getAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.Serializable
getValue()
The value represented by this attribute.int
hashCode()
void
setAttributes(Map<String,Object> attributes)
Map holding any additional attributes passed in the request not matching any defined properties.void
setValue(Serializable value)
The value represented by this attribute.String
toString()
-
-
-
Constructor Detail
-
Attribute
public Attribute()
-
Attribute
public Attribute(Serializable value, Map<String,Object> attributes)
-
-
Method Detail
-
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 attributevalue
- 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.
-
canEqual
protected boolean canEqual(Object other)
-
-