Class ProductOption
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.ProductOption
- All Implemented Interfaces:
Serializable
A "product option" encapsulates additional, variable information about a Product
explicitly designed for customer-facing input. This can be info necessary for distinguishing
particular variants such as shirt size, color, or material, or it can be some
custom user-input such as a name to emboss on the back of a jersey. Finally, it can even drive
additional products that should be added to the cart along with the product that it is configured
for.
- Author:
- Nathan Moore (nathandmoore)
- 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.Configuration for theDefaultProductOptionType.ITEM_CHOICE.getType()Controls both how the customer should be inputting values to fill out this option as well as storage of where the value will go once added to the cart.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetItemChoice(ItemChoice itemChoice) Configuration for theDefaultProductOptionType.ITEM_CHOICE.voidControls both how the customer should be inputting values to fill out this option as well as storage of where the value will go once added to the cart.toString()
-
Constructor Details
-
ProductOption
public ProductOption()
-
-
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.
-
getType
Controls both how the customer should be inputting values to fill out this option as well as storage of where the value will go once added to the cart.- Returns:
- which type of input this option is configured for
- See Also:
-
getItemChoice
Configuration for theDefaultProductOptionType.ITEM_CHOICE. Drives customer selection of an additional item to add to their cart- Returns:
- configuration if the type of this option is an
DefaultProductOptionType.ITEM_CHOICE, otherwise null
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setType
Controls both how the customer should be inputting values to fill out this option as well as storage of where the value will go once added to the cart.- Parameters:
type- the type of input that the drives customer selection, defaults fromDefaultProductOptionType- See Also:
-
setItemChoice
Configuration for theDefaultProductOptionType.ITEM_CHOICE. Drives customer selection of an additional item to add to their cart- Parameters:
itemChoice- configuration only whentypeisDefaultProductOptionType.ITEM_CHOICE
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-