Class ItemChoice
java.lang.Object
com.broadleafcommerce.cartoperation.domain.ItemChoice
- All Implemented Interfaces:
Serializable
Configuration state for
ProductOptionType.ITEM_CHOICE
.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected boolean
boolean
com.broadleafcommerce.cart.client.domain.AdditionalItemPricing
Return 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.TheCategory
which the add-on will be chosen from by the customer if theselection
isItemChoiceTargetType.CATEGORY
.The key to use to relate to thisItemChoice
when configuring cart items.The maximum amount of this item that a customer can purchase at a time.The minimum amount of the item that a customer must purchase.javax.money.MonetaryAmount
Describes restrictions placed on the customer's ability to select items from the targeted set.If theselectionType
isItemChoiceTargetType.SPECIFIC_PRODUCTS
orItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from.Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.int
hashCode()
boolean
Dictates whether or not discounts are allowed to be applied to this add-on.void
setAdditionalItemPricing
(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing) void
setAttributes
(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.void
setCategory
(Category category) TheCategory
which the add-on will be chosen from by the customer if theselection
isItemChoiceTargetType.CATEGORY
.void
setChoiceKey
(String choiceKey) The key to use to relate to thisItemChoice
when configuring cart items.void
setDiscountAllowed
(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this add-on.void
setMaximumQuantity
(Integer maximumQuantity) The maximum amount of this item that a customer can purchase at a time.void
setMinimumQuantity
(Integer minimumQuantity) The minimum amount of the item that a customer must purchase.void
setOverridePrice
(javax.money.MonetaryAmount overridePrice) void
setPricingKey
(String pricingKey) void
setPricingTargetType
(String pricingTargetType) void
setSelectionType
(String selectionType) Describes restrictions placed on the customer's ability to select items from the targeted set.void
setSpecificChoices
(List<SpecificItemChoice> specificChoices) If theselectionType
isItemChoiceTargetType.SPECIFIC_PRODUCTS
orItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from.void
setSpecificItemChoice
(SpecificItemChoice specificItemChoice) void
setTargetType
(String targetType) Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.toString()
-
Constructor Details
-
ItemChoice
public ItemChoice()
-
-
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.
-
getChoiceKey
The key to use to relate to thisItemChoice
when configuring cart items.- Returns:
- The key to use to relate to this
ItemChoice
when configuring cart items.
-
getTargetType
Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.- Returns:
- the
ItemChoiceTargetType
of this add-on - See Also:
-
getSelectionType
Describes restrictions placed on the customer's ability to select items from the targeted set. Generally, this is a restriction on how many choices can be selected for a single add-to-cart request and, potentially, how quantity is distributed among multiple selected choices.- Returns:
- the
ItemChoiceSelectionType
of this item choice - See Also:
-
getMaximumQuantity
The maximum amount of this item that a customer can purchase at a time. If null, this would allow a customer to specify their own quantity for how many of these items they can add to the cart.- Returns:
- the maximum quantity of the add-on's target product(s) that can be added
-
getMinimumQuantity
The minimum amount of the item that a customer must purchase. The minimum and maximum should never be the same as this domain would be better represented as anIncludedProduct
.- Returns:
- the minimum quantity of the add-on's target product(s)
-
isDiscountAllowed
public boolean isDiscountAllowed()Dictates whether or not discounts are allowed to be applied to this add-on.- Returns:
- true if discounts are allowed to be applied to this add-on, false otherwise
-
getAdditionalItemPricing
public com.broadleafcommerce.cart.client.domain.AdditionalItemPricing getAdditionalItemPricing() -
getCategory
TheCategory
which the add-on will be chosen from by the customer if theselection
isItemChoiceTargetType.CATEGORY
.- Returns:
- the category from which the add-on will be chosen from or {@link null} if
getSelectionType()
is notItemChoiceTargetType.CATEGORY
-
getSpecificChoices
If theselectionType
isItemChoiceTargetType.SPECIFIC_PRODUCTS
orItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from. This also allows for specific override pricing on an item-by-item basis- Returns:
- the explicit choices for
ItemChoiceTargetType.SPECIFIC_PRODUCTS
orItemChoiceTargetType.SPECIFIC_VARIANTS
value of theselectionType
-
getSpecificItemChoice
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setChoiceKey
The key to use to relate to thisItemChoice
when configuring cart items.- Parameters:
choiceKey
- The key to use to relate to thisItemChoice
when configuring cart items.
-
setTargetType
Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.- Parameters:
type
- theItemChoiceTargetType
of this add-on- See Also:
-
setSelectionType
Describes restrictions placed on the customer's ability to select items from the targeted set. Generally, this is a restriction on how many choices can be selected for a single add-to-cart request and, potentially, how quantity is distributed among multiple selected choices.- Parameters:
selectionType
- theItemChoiceSelectionType
of this item choice- See Also:
-
setMaximumQuantity
The maximum amount of this item that a customer can purchase at a time. If null, this would allow a customer to specify their own quantity for how many of these items they can add to the cart.- Parameters:
maximumQuantity
- the maximum quantity of the add-on's target product(s) that can be added
-
setMinimumQuantity
The minimum amount of the item that a customer must purchase. The minimum and maximum should never be the same as this domain would be better represented as anIncludedProduct
.- Parameters:
minimumQuantity
- the minimum quantity of the add-on's target product(s)
-
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this add-on.- Parameters:
discountAllowed
- true if discounts are allowed to be applied to this add-on, false otherwise
-
setAdditionalItemPricing
public void setAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing) -
setCategory
TheCategory
which the add-on will be chosen from by the customer if theselection
isItemChoiceTargetType.CATEGORY
.- Parameters:
category
- the category from which the add-on will be chosen from
-
setSpecificChoices
If theselectionType
isItemChoiceTargetType.SPECIFIC_PRODUCTS
orItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from. This also allows for specific override pricing on an item-by-item basis- Parameters:
specificChoices
- manually-curated options for the user to choose from for this addon
-
setSpecificItemChoice
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice() -
getPricingKey
-
getPricingTargetType
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) -
setPricingKey
-
setPricingTargetType
-