Class AttributeChoiceValue
java.lang.Object
com.broadleafcommerce.catalog.domain.product.option.AttributeChoiceValue
- All Implemented Interfaces:
com.broadleafcommerce.translation.mapping.SubIdentifiable,Serializable,Comparable<AttributeChoiceValue>
public class AttributeChoiceValue
extends Object
implements Serializable, Comparable<AttributeChoiceValue>, com.broadleafcommerce.translation.mapping.SubIdentifiable
A single value with a display, order and label within a
AttributeChoice- Author:
- Phillip Verheyden (phillipuniverse)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanintOrder by thedisplayOrderand then the label with nulls lastbooleanAdditional attributes that can be used to store extra information about this value.How this value displays in the context of all other values within a singleAttributeChoicegetId()getLabel()What the customer sees for display.getValue()The value stored as an item attribute or cart attribute based on what the user selects.inthashCode()booleanisActive()Whether this value is active.voidsetActive(boolean active) Whether this value is active.voidsetAttributes(Map<String, Object> attributes) Additional attributes that can be used to store extra information about this value.voidsetDisplayOrder(Integer displayOrder) How this value displays in the context of all other values within a singleAttributeChoicevoidvoidWhat the customer sees for display.voidThe value stored as an item attribute or cart attribute based on what the user selects.toString()
-
Constructor Details
-
AttributeChoiceValue
-
AttributeChoiceValue
public AttributeChoiceValue()
-
-
Method Details
-
compareTo
Order by thedisplayOrderand then the label with nulls last- Specified by:
compareToin interfaceComparable<AttributeChoiceValue>
-
getId
- Specified by:
getIdin interfacecom.broadleafcommerce.translation.mapping.SubIdentifiable- See Also:
-
SubIdentifiable.getId()
-
getLabel
What the customer sees for display. For example, text in the case of sizes or a hex value in the case of colors. Can diverge fromvaluewhich is what is added to the cart- Returns:
- the customer-facing display. If null, the
getValue()should be used for display
-
getValue
The value stored as an item attribute or cart attribute based on what the user selects. This field is required, but can be different than the customer-facing display inlabel- Returns:
- the value that should be stored as an item/cart attribute when the user selects this choice
-
getDisplayOrder
How this value displays in the context of all other values within a singleAttributeChoice- Returns:
- the ordering of this value or {@link null} in which case this should be ordered at the end
-
isActive
public boolean isActive()Whether this value is active. This is used to determine if this value should be displayed.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
getAttributes
Additional attributes that can be used to store extra information about this value.- Since:
- Catalog Services 2.3.0, Release Train 2.3.0
-
setId
- Specified by:
setIdin interfacecom.broadleafcommerce.translation.mapping.SubIdentifiable- See Also:
-
SubIdentifiable.getId()
-
setLabel
What the customer sees for display. For example, text in the case of sizes or a hex value in the case of colors. Can diverge fromvaluewhich is what is added to the cart- Parameters:
label- customer-facing display of this value
-
setValue
The value stored as an item attribute or cart attribute based on what the user selects. This field is required, but can be different than the customer-facing display inlabel- Parameters:
value- what will be stored as an item/cart attribute
-
setDisplayOrder
How this value displays in the context of all other values within a singleAttributeChoice- Parameters:
displayOrder- ordering of this value in relation to other values in the sameAttributeChoice
-
setActive
public void setActive(boolean active) Whether this value is active. This is used to determine if this value should be displayed.- Since:
- Catalog Service 2.2.1, Release Train 2.2.1
-
setAttributes
Additional attributes that can be used to store extra information about this value.- Since:
- Catalog Services 2.3.0, Release Train 2.3.0
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-