Class DataDrivenEnum
- All Implemented Interfaces:
Serializable
- Author:
- Sunny Yu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanReturn any additional attributes passed in the request not matching any defined properties.Map holding any additional attributes passed in the request not matching any defined properties.The display value for the associatedtype.getId()The ID of the enum.getType()Identifies the type of the associated value, this is needed to gather all the enumvaluesbased on their types.getValue()The value of the associatedtype.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetDisplayValue(String displayValue) The display value for the associatedtype.voidThe ID of the enum.voidIdentifies the type of the associated value, this is needed to gather all the enumvaluesbased on their types.voidThe value of the associatedtype.toString()
-
Constructor Details
-
DataDrivenEnum
public DataDrivenEnum()
-
-
Method Details
-
addAttribute
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
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
The ID of the enum.- Returns:
- the context ID of this enum
-
getType
Identifies the type of the associated value, this is needed to gather all the enumvaluesbased 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
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
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
Map holding any additional attributes passed in the request not matching any defined properties. -
setId
The ID of the enum.- Parameters:
id- the context ID of this enum
-
setType
Identifies the type of the associated value, this is needed to gather all the enumvaluesbased 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
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
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
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-