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
ConstructorsConstructorDescriptionItemChoiceDetail(ItemChoice itemChoice, ItemChoiceCategory category, ProductDetails defaultProductInCategory, ProductDetails defaultProduct, VariantDetail defaultVariant, PriceInfo priceInfo, List<SpecificItemChoiceDetail> specificChoices, SpecificItemChoiceDetail specificItemChoice) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanTheItemChoiceCategorywhich the choice will be chosen from by the customer if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.javax.money.MonetaryAmountThe 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.MonetaryAmountSummary of thepricing informationrelated to the choice.If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from.If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis holds the manually selected option that the customer can choose to add on.inthashCode()booleanvoidsetCategory(ItemChoiceCategory category) TheItemChoiceCategorywhich the choice will be chosen from by the customer if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.voidsetChoiceKey(String choiceKey) voidsetDefaultProduct(ProductDetails defaultProduct) The default product that can be used when driving customer selections if thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS.voidsetDefaultProductInCategory(ProductDetails defaultProductInCategory) The default product that can be used when driving customer selections if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.voidsetDefaultVariant(VariantDetail defaultVariant) The default variant that can be used when driving customer selections if thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_VARIANTS.voidsetDiscountAllowed(boolean discountAllowed) voidsetItemChoice(ItemChoice itemChoice) voidsetMaximumQuantity(Integer maximumQuantity) voidsetMinimumQuantity(Integer minimumQuantity) voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) voidsetPriceInfo(PriceInfo priceInfo) Summary of thepricing informationrelated to the choice.voidsetPricingKey(String pricingKey) voidsetSelectionType(String selectionType) voidsetSpecificChoices(List<SpecificItemChoiceDetail> specificChoices) If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from.voidsetSpecificItemChoice(SpecificItemChoiceDetail specificItemChoice) If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis holds the manually selected option that the customer can choose to add on.voidsetTargetType(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
TheItemChoiceCategorywhich 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 informationrelated to the choice.- Returns:
- Summary of the
pricing informationrelated to the choice
-
getSpecificChoices
If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSthis 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_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSvalue of thegetTargetType()
-
getSpecificItemChoice
If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis 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_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTvalue of thegetTargetType()
-
setItemChoice
-
setCategory
TheItemChoiceCategorywhich 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 informationrelated to the choice.- Parameters:
priceInfo- Summary of thepricing informationrelated to the choice
-
setSpecificChoices
If thegetTargetType()isDefaultItemChoiceTargetType.SPECIFIC_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSthis 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_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis 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
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice() -
isDiscountAllowed
public boolean isDiscountAllowed() -
getTargetType
-
getSelectionType
-
getChoiceKey
-
getMaximumQuantity
-
getMinimumQuantity
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice() -
getPricingKey
-
setTargetType
-
setSelectionType
-
setChoiceKey
-
setMaximumQuantity
-
setMinimumQuantity
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) -
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) -
setPricingKey
-