Class DataDrivenEnum
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.domain.DataDrivenEnum
-
- All Implemented Interfaces:
Serializable
public class DataDrivenEnum extends Object implements Serializable
A reference to a data driven enum, typically used as a holder for information communicated from an external service.- Author:
- Sunny Yu
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DataDrivenEnum()
-
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.String
getDisplayValue()
The display value for the associatedtype
.String
getId()
The ID of the enum.String
getType()
Identifies the type of the associated value, this is needed to gather all the enumvalues
based on their types.String
getValue()
The value of the associatedtype
.int
hashCode()
void
setAttributes(Map<String,Object> attributes)
Map holding any additional attributes passed in the request not matching any defined properties.void
setDisplayValue(String displayValue)
The display value for the associatedtype
.void
setId(String id)
The ID of the enum.void
setType(String type)
Identifies the type of the associated value, this is needed to gather all the enumvalues
based on their types.void
setValue(String value)
The value of the associatedtype
.String
toString()
-
-
-
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.
-
getId
public String getId()
The ID of the enum.- Returns:
- the context ID of this enum
-
getType
public String getType()
Identifies the type of the associated value, this is needed to gather all the enumvalues
based on their types.For example, if this enum type was to be used for a field representing product's materials, then the type would be "MATERIAL".
- Returns:
- the type for the associated value
-
getValue
public String getValue()
The value of the associatedtype
.For example, the value for type "MATERIAL" could be "COTTON", "LEATHER", "POLYESTER", etc.
- Returns:
- the value of the associated type
-
getDisplayValue
public String getDisplayValue()
The display value for the associatedtype
.Different from
value
, the display value is meant to be more user-friendly and for client-facing usages, such as searching and faceting.For example, the display value for type "MATERIAL" could be "Cotton", "Leather", "Polyester", etc.
- Returns:
- the display value of the associated type
-
getAttributes
public Map<String,Object> getAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.
-
setId
public void setId(String id)
The ID of the enum.- Parameters:
id
- the context ID of this enum
-
setType
public void setType(String type)
Identifies the type of the associated value, this is needed to gather all the enumvalues
based on their types.For example, if this enum type was to be used for a field representing product's materials, then the type would be "MATERIAL".
- Parameters:
type
- the type for the associated value
-
setValue
public void setValue(String value)
The value of the associatedtype
.For example, the value for type "MATERIAL" could be "COTTON", "LEATHER", "POLYESTER", etc.
- Parameters:
value
- the value of the associated type
-
setDisplayValue
public void setDisplayValue(String displayValue)
The display value for the associatedtype
.Different from
value
, the display value is meant to be more user-friendly and for client-facing usages, such as searching and faceting.For example, the display value for type "MATERIAL" could be "Cotton", "Leather", "Polyester", etc.
- Parameters:
displayValue
- the display value of the associated type
-
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)
-
-