Class ItemChoiceDetail
java.lang.Object
com.broadleafcommerce.catalog.domain.product.commerce.ItemChoiceDetail
- All Implemented Interfaces:
Serializable
A version of
ItemChoice
tailored toward the needs of a commerce-facing product details
page.- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
ConstructorDescriptionItemChoiceDetail
(ItemChoice itemChoice, ItemChoiceCategory category, ProductDetails defaultProductInCategory, ProductDetails defaultProduct, VariantDetail defaultVariant, PriceInfo priceInfo, List<SpecificItemChoiceDetail> specificChoices, SpecificItemChoiceDetail specificItemChoice) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
<T> T
getAttribute
(String name) TheItemChoiceCategory
which the choice will be chosen from by the customer if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.javax.money.MonetaryAmount
The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
.The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.The default variant that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
.javax.money.MonetaryAmount
Summary of thepricing information
related to the choice.If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
orDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from.If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCT
orDefaultItemChoiceTargetType.SPECIFIC_VARIANT
this holds the manually selected option that the customer can choose to add on.int
hashCode()
boolean
void
setAttributes
(Map<String, Object> attributes) void
setCategory
(ItemChoiceCategory category) TheItemChoiceCategory
which the choice will be chosen from by the customer if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.void
setChoiceKey
(String choiceKey) void
setDefaultProduct
(ProductDetails defaultProduct) The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
.void
setDefaultProductInCategory
(ProductDetails defaultProductInCategory) The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.void
setDefaultVariant
(VariantDetail defaultVariant) The default variant that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
.void
setDiscountAllowed
(boolean discountAllowed) void
setItemChoice
(ItemChoice itemChoice) void
setMaximumQuantity
(Integer maximumQuantity) void
setMinimumQuantity
(Integer minimumQuantity) void
setOverridePrice
(javax.money.MonetaryAmount overridePrice) void
setPriceInfo
(PriceInfo priceInfo) Summary of thepricing information
related to the choice.void
setPricingKey
(String pricingKey) void
setSelectionType
(String selectionType) void
setSpecificChoices
(List<SpecificItemChoiceDetail> specificChoices) If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
orDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
this holds the manually-curated options that the customer can choose from.void
setSpecificItemChoice
(SpecificItemChoiceDetail specificItemChoice) If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCT
orDefaultItemChoiceTargetType.SPECIFIC_VARIANT
this holds the manually selected option that the customer can choose to add on.void
setTargetType
(String targetType) toString()
-
Constructor Details
-
ItemChoiceDetail
public ItemChoiceDetail(ItemChoice itemChoice, ItemChoiceCategory category, ProductDetails defaultProductInCategory, ProductDetails defaultProduct, VariantDetail defaultVariant, PriceInfo priceInfo, List<SpecificItemChoiceDetail> specificChoices, SpecificItemChoiceDetail specificItemChoice) -
ItemChoiceDetail
public ItemChoiceDetail()
-
-
Method Details
-
getItemChoice
-
getCategory
TheItemChoiceCategory
which the choice will be chosen from by the customer if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
. This will include the products in the category.- Returns:
- the category from which the choice will be chosen from or {@link null} if
getTargetType()
is notDefaultItemChoiceTargetType.CATEGORY
. This will include the products in the category.
-
getDefaultProductInCategory
The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.- Returns:
- the defaulted selection for this choice if the
getTargetType()
isDefaultItemChoiceTargetType.CATEGORY
, null otherwise or if there is no default selection
-
getDefaultProduct
The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
. Can be null.- Returns:
- the defaulted selection for this choice if the
getTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
, null otherwise or if there is no default selection
-
getDefaultVariant
The default variant that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
. Can be null.- Returns:
- the defaulted selection for this choice if the
getTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
, null otherwise or if there is no default selection
-
getPriceInfo
Summary of thepricing information
related to the choice.- Returns:
- Summary of the
pricing information
related to the choice
-
getSpecificChoices
If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
orDefaultItemChoiceTargetType.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
DefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
orDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
value of thegetTargetType()
-
getSpecificItemChoice
If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCT
orDefaultItemChoiceTargetType.SPECIFIC_VARIANT
this holds the manually selected option that the customer can choose to add on. This also allows for specific override pricing.- Returns:
- the explicit choice for
DefaultItemChoiceTargetType.SPECIFIC_PRODUCT
orDefaultItemChoiceTargetType.SPECIFIC_VARIANT
value of thegetTargetType()
-
setItemChoice
-
setCategory
TheItemChoiceCategory
which the choice will be chosen from by the customer if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
. This will include the products in the category.- Parameters:
category
- the category from which the choice will be chosen from
-
setDefaultProductInCategory
The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
.- Parameters:
defaultProduct
- the default product that is automatically selected when thegetTargetType()
isDefaultItemChoiceTargetType.CATEGORY
. Should come from within thecategory
-
setDefaultProduct
The default product that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
. Can be null.- Parameters:
defaultProduct
- the default product that is automatically selected when thegetTargetType()
is {DefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
. Should come from the specific set of products inspecificChoices
-
setDefaultVariant
The default variant that can be used when driving customer selections if thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
. Can be null.- Parameters:
defaultVariant
- the default variant that is automatically selected when thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS
. Should come from the explicit set of variants inspecificChoices
-
setPriceInfo
Summary of thepricing information
related to the choice.- Parameters:
priceInfo
- Summary of thepricing information
related to the choice
-
setSpecificChoices
If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS
orDefaultItemChoiceTargetType.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 choice
-
setSpecificItemChoice
If thegetTargetType()
isDefaultItemChoiceTargetType.SPECIFIC_PRODUCT
orDefaultItemChoiceTargetType.SPECIFIC_VARIANT
this holds the manually selected option that the customer can choose to add on. This also allows for specific override pricing.- Parameters:
specificChoice
- manually selected option for the user to choose to add on
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getAttribute
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice() -
isDiscountAllowed
public boolean isDiscountAllowed() -
getTargetType
-
getSelectionType
-
getChoiceKey
-
getMaximumQuantity
-
getMinimumQuantity
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice() -
getPricingKey
-
getAttributes
-
setTargetType
-
setSelectionType
-
setChoiceKey
-
setMaximumQuantity
-
setMinimumQuantity
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) -
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) -
setPricingKey
-
setAttributes
-