Class DataDrivenEnum
- java.lang.Object
-
- com.broadleafcommerce.catalogbrowse.domain.DataDrivenEnum
-
- All Implemented Interfaces:
Serializable
public class DataDrivenEnum extends Object implements Serializable
A structure containing all the info necessary for data driven enum details section shown in a commerce-facing app (as opposed to a PIM UI).- 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 protected booleancanEqual(Object other)booleanequals(Object o)StringgetDisplayValue()The display value for the associatedtype.StringgetId()The context ID of this enum.StringgetType()Identifies the type of the associated value, this is needed to gather all the enumvaluesbased on their types.StringgetValue()The value of the associatedtype.inthashCode()booleanisAssociatedCategoryExists()voidsetAssociatedCategoryExists(boolean associatedCategoryExists)voidsetDisplayValue(String displayValue)The display value for the associatedtype.voidsetId(String id)The context ID of this enum.voidsetType(String type)Identifies the type of the associated value, this is needed to gather all the enumvaluesbased on their types.voidsetValue(String value)The value of the associatedtype.StringtoString()
-
-
-
Method Detail
-
getId
public String getId()
The context ID of this enum.- Returns:
- the context ID of this enum
-
isAssociatedCategoryExists
public boolean isAssociatedCategoryExists()
Declares whether there is aCategoryassociated with thisDataDrivenEnumbased ongetValue().Since
DataDrivenEnumis used to represent some product fields such as product's brand, there are categories expected to exist to further categorize products based on the data driven enum values.For example, if a product's brand is a
DataDrivenEnumwith the valueSOME_BRAND_NAME, a category with the url/some-brand-nameis expected to be created for this brand.
-
getType
public String 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
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
-
setId
public void setId(String id)
The context ID of this enum.- Parameters:
id- the context ID of this enum
-
setAssociatedCategoryExists
public void setAssociatedCategoryExists(boolean associatedCategoryExists)
Declares whether there is aCategoryassociated with thisDataDrivenEnumbased ongetValue().Since
DataDrivenEnumis used to represent some product fields such as product's brand, there are categories expected to exist to further categorize products based on the data driven enum values.For example, if a product's brand is a
DataDrivenEnumwith the valueSOME_BRAND_NAME, a category with the url/some-brand-nameis expected to be created for this brand.
-
setType
public void setType(String type)
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
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
-
canEqual
protected boolean canEqual(Object other)
-
-