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 booleanboolean<T> TgetAttribute(String name) TheItemChoiceCategorywhich the choice will be chosen from by the customer if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.javax.money.MonetaryAmountjavax.money.MonetaryAmountjavax.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()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetAllowAddAfterInitialPurchase(boolean allowAddAfterInitialPurchase) voidsetAllowEditAfterInitialPurchase(boolean allowEditAfterInitialPurchase) voidsetAllowQtyEditAfterInitialPurchase(boolean allowQtyEditAfterInitialPurchase) voidsetAllowRemoveAfterInitialPurchase(boolean allowRemoveAfterInitialPurchase) voidsetAttributes(Map<String, Object> attributes) voidsetCategory(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) voidsetHasPostPurchaseEditRules(boolean hasPostPurchaseEditRules) voidsetItemChoice(ItemChoice itemChoice) voidsetMaximumQuantity(Integer maximumQuantity) voidsetMinimumQuantity(Integer minimumQuantity) voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) voidsetPriceInfo(PriceInfo priceInfo) Summary of thepricing informationrelated to the choice.voidsetPriceOverridden(boolean priceOverridden) voidsetPricingKey(String pricingKey) voidsetRestrictQtyDecreaseAfterDays(Integer restrictQtyDecreaseAfterDays) voidsetRestrictRemovalAfterDays(Integer restrictRemovalAfterDays) voidsetSelectionType(String selectionType) voidsetSeparateFromPrimaryItem(boolean isSeparateFromPrimaryItem) 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.voidsetSubscription(boolean isSubscription) 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
-
getAttribute
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice() -
getDefaultChoicePrice
public javax.money.MonetaryAmount getDefaultChoicePrice() -
getDefaultChoiceOverridePrice
public javax.money.MonetaryAmount getDefaultChoiceOverridePrice() -
getDefaultChoiceUnderlyingSku
-
getDefaultChoiceUnderlyingPricingKey
-
getDefaultChoiceUnderlyingDefaultTerm
-
getDefaultChoicePricingKey
-
isDiscountAllowed
public boolean isDiscountAllowed() -
getTargetType
-
getSelectionType
-
getChoiceKey
-
getMaximumQuantity
-
getMinimumQuantity
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice() -
getPricingKey
-
isPriceOverridden
public boolean isPriceOverridden() -
getAttributes
-
isSubscription
public boolean isSubscription() -
isHasPostPurchaseEditRules
public boolean isHasPostPurchaseEditRules() -
isAllowEditAfterInitialPurchase
public boolean isAllowEditAfterInitialPurchase() -
isAllowQtyEditAfterInitialPurchase
public boolean isAllowQtyEditAfterInitialPurchase() -
isAllowAddAfterInitialPurchase
public boolean isAllowAddAfterInitialPurchase() -
isAllowRemoveAfterInitialPurchase
public boolean isAllowRemoveAfterInitialPurchase() -
getRestrictQtyDecreaseAfterDays
-
getRestrictRemovalAfterDays
-
isSeparateFromPrimaryItem
public boolean isSeparateFromPrimaryItem() -
setTargetType
-
setSelectionType
-
setChoiceKey
-
setMaximumQuantity
-
setMinimumQuantity
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) -
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) -
setPricingKey
-
setPriceOverridden
public void setPriceOverridden(boolean priceOverridden) -
setAttributes
-
setSubscription
public void setSubscription(boolean isSubscription) -
setHasPostPurchaseEditRules
public void setHasPostPurchaseEditRules(boolean hasPostPurchaseEditRules) -
setAllowEditAfterInitialPurchase
public void setAllowEditAfterInitialPurchase(boolean allowEditAfterInitialPurchase) -
setAllowQtyEditAfterInitialPurchase
public void setAllowQtyEditAfterInitialPurchase(boolean allowQtyEditAfterInitialPurchase) -
setAllowAddAfterInitialPurchase
public void setAllowAddAfterInitialPurchase(boolean allowAddAfterInitialPurchase) -
setAllowRemoveAfterInitialPurchase
public void setAllowRemoveAfterInitialPurchase(boolean allowRemoveAfterInitialPurchase) -
setRestrictQtyDecreaseAfterDays
-
setRestrictRemovalAfterDays
-
setSeparateFromPrimaryItem
public void setSeparateFromPrimaryItem(boolean isSeparateFromPrimaryItem)
-