Enum ProductOptionType
- java.lang.Object
-
- java.lang.Enum<ProductOptionType>
-
- com.broadleafcommerce.cartoperation.domain.ProductOptionType
-
- All Implemented Interfaces:
Serializable
,Comparable<ProductOptionType>
public enum ProductOptionType extends Enum<ProductOptionType>
Out of the box forms that aProductOption
can take. For more information on the types see the documentation forproduct options
.- Author:
- Phillip Verheyden (phillipuniverse)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CART_ATTRIBUTE
The user input flow into a global cart-level attribute when added to cart.CART_ITEM_ATTRIBUTE
The user value is intended to flow into an item attribute once this item is added to the cart.ITEM_CHOICE
Allows the user to select an additional item that is added to their cartVARIANT_DISTINGUISHING
Values selected by the customer will help distinguish a specific variant directly on this Product that should be added to the cart.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAttributeChoice(String optionType)
static boolean
isCartAttributeChoice(String optionType)
static boolean
isCartItemAttributeChoice(String optionType)
static boolean
isItemChoice(String optionType)
static boolean
isVariantDistinguishing(String optionType)
static ProductOptionType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ProductOptionType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VARIANT_DISTINGUISHING
public static final ProductOptionType VARIANT_DISTINGUISHING
Values selected by the customer will help distinguish a specific variant directly on this Product that should be added to the cart. Example would be to set up t-shirts with colors and sizes. This is similar toCART_ITEM_ATTRIBUTE
in that the values the user selected are stored in the item attributes.
-
ITEM_CHOICE
public static final ProductOptionType ITEM_CHOICE
Allows the user to select an additional item that is added to their cart
-
CART_ITEM_ATTRIBUTE
public static final ProductOptionType CART_ITEM_ATTRIBUTE
The user value is intended to flow into an item attribute once this item is added to the cart.
-
CART_ATTRIBUTE
public static final ProductOptionType CART_ATTRIBUTE
The user input flow into a global cart-level attribute when added to cart. If there was already an entry for this attribute, it is overridden with the latest value
-
-
Method Detail
-
values
public static ProductOptionType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProductOptionType c : ProductOptionType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProductOptionType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isItemChoice
public static boolean isItemChoice(String optionType)
-
isCartItemAttributeChoice
public static boolean isCartItemAttributeChoice(String optionType)
-
isCartAttributeChoice
public static boolean isCartAttributeChoice(String optionType)
-
isVariantDistinguishing
public static boolean isVariantDistinguishing(String optionType)
-
isAttributeChoice
public static boolean isAttributeChoice(String optionType)
-
-