public class ProductOption extends Object implements Serializable
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.Constructor and Description |
---|
ProductOption() |
Modifier and Type | Method and 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.
|
AttributeChoice |
getAttributeChoice()
Configuration when the
type of this option is one of:
ProductOptionType.VARIANT_DISTINGUISHING - drives customer further specifying
their choices into a specific Variant that contains a unique SKU code, pricing
concerns, etc.
ProductOptionType.CART_ITEM_ATTRIBUTE - Customer input will flow directly in the
item attributes within their cart
ProductOptionType.CART_ATTRIBUTE . |
Map<String,Object> |
getAttributes()
Map holding any additional attributes passed in the request not matching any defined
properties.
|
ItemChoice |
getItemChoice()
Configuration for the
ProductOptionType.ITEM_CHOICE . |
String |
getLabel()
The label shown to customers when displaying this option.
|
String |
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.
|
int |
hashCode() |
void |
setAttributeChoice(AttributeChoice attributeChoice)
Configuration when the
type of this option is one of:
ProductOptionType.VARIANT_DISTINGUISHING - drives customer further specifying
their choices into a specific Variant that contains a unique SKU code, pricing
concerns, etc.
ProductOptionType.CART_ITEM_ATTRIBUTE - Customer input will flow directly in the
item attributes within their cart
ProductOptionType.CART_ATTRIBUTE . |
void |
setAttributes(Map<String,Object> attributes)
Map holding any additional attributes passed in the request not matching any defined
properties.
|
void |
setItemChoice(ItemChoice itemChoice)
Configuration for the
ProductOptionType.ITEM_CHOICE . |
void |
setLabel(String label)
The label shown to customers when displaying this option.
|
void |
setType(String type)
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.
|
String |
toString() |
public void addAttribute(String name, Object value)
name
- Name of the additional attributevalue
- Value of the additional attributepublic Map<String,Object> getAttribute()
public String getType()
ProductOptionType
public String getLabel()
public ItemChoice getItemChoice()
ProductOptionType.ITEM_CHOICE
. Drives customer selection of an
additional item to add to their cartProductOptionType.ITEM_CHOICE
,
otherwise nullpublic AttributeChoice getAttributeChoice()
Configuration when the type
of this option is one of:
ProductOptionType.VARIANT_DISTINGUISHING
- drives customer further specifying
their choices into a specific Variant
that contains a unique SKU code, pricing
concerns, etc.ProductOptionType.CART_ITEM_ATTRIBUTE
- Customer input will flow directly in the
item attributes within their cartProductOptionType.CART_ATTRIBUTE
. Customer input will flow directly in the global
cart attribute. Any previously-set attribute should be replaced with new values.ProductOptionType.VARIANT_DISTINGUISHING
,
ProductOptionType.CART_ITEM_ATTRIBUTE
or
ProductOptionType.CART_ATTRIBUTE
, otherwise nullpublic Map<String,Object> getAttributes()
public void setType(String type)
type
- the type of input that the drives customer selection, defaults from
ProductOptionType
ProductOptionType
public void setLabel(String label)
label
- the display shown to customers for this optionpublic void setItemChoice(ItemChoice itemChoice)
ProductOptionType.ITEM_CHOICE
. Drives customer selection of an
additional item to add to their cartitemChoice
- configuration only when type
is
ProductOptionType.ITEM_CHOICE
public void setAttributeChoice(AttributeChoice attributeChoice)
Configuration when the type
of this option is one of:
ProductOptionType.VARIANT_DISTINGUISHING
- drives customer further specifying
their choices into a specific Variant
that contains a unique SKU code, pricing
concerns, etc.ProductOptionType.CART_ITEM_ATTRIBUTE
- Customer input will flow directly in the
item attributes within their cartProductOptionType.CART_ATTRIBUTE
. Customer input will flow directly in the global
cart attribute. Any previously-set attribute should be replaced with new values.attributeChoice
- configuration for customer-driven values that flow into an attributepublic void setAttributes(Map<String,Object> attributes)
protected boolean canEqual(Object other)
Copyright © 2021. All rights reserved.