Class ItemChoice
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.ItemChoice
- All Implemented Interfaces:
Priceable,Serializable
Configuration state for
DefaultProductOptionType.ITEM_CHOICE.- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected booleanbooleanReturn 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.TheItemChoiceCategorywhich the choice will be chosen from by the customer if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.The key used during the validation of cart item's configuration to relate thisItemChoiceto one of the cart item's dependent items.The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS.The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.CATEGORY.The default variant that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS.com.broadleafcommerce.pricing.client.domain.PriceInfoSummary of thepricing informationrelated to the choice.System-wide unique identifier to configure specific pricing for the choice.If thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis holds the manually selected option that the customer can choose to add on.Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetCategory(ItemChoiceCategory category) TheItemChoiceCategorywhich the choice will be chosen from by the customer if thegetTargetType()isDefaultItemChoiceTargetType.CATEGORY.voidsetChoiceKey(String choiceKey) The key used during the validation of cart item's configuration to relate thisItemChoiceto one of the cart item's dependent items.voidsetDefaultProduct(Product defaultProduct) The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS.voidsetDefaultProductInCategory(Product defaultProductInCategory) The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.CATEGORY.voidsetDefaultVariant(Variant defaultVariant) The default variant that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS.voidsetPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the choice.voidsetPricingKey(String pricingKey) System-wide unique identifier to configure specific pricing for the choice.voidsetSpecificChoices(List<SpecificItemChoice> specificChoices) If thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTSorDefaultItemChoiceTargetType.SPECIFIC_VARIANTSthis holds the manually-curated options that the customer can choose from.voidsetSpecificItemChoice(SpecificItemChoice specificItemChoice) If thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTorDefaultItemChoiceTargetType.SPECIFIC_VARIANTthis holds the manually selected option that the customer can choose to add on.voidsetTargetType(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.
-
getSpecificChoices
-
getChoiceKey
The key used during the validation of cart item's configuration to relate thisItemChoiceto one of the cart item's dependent items.- Returns:
- The key used during the validation of cart item's configuration to relate this
ItemChoiceto one of the cart item's dependent items.
-
getPricingKey
System-wide unique identifier to configure specific pricing for the choice. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Returns:
- a unique key to identify this choice
-
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
DefaultItemChoiceTargetTypeof this item choice - See Also:
-
getDefaultProductInCategory
The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.CATEGORY.- Returns:
- the defaulted selection for this choice if the
targetTypeisDefaultItemChoiceTargetType.CATEGORY, null otherwise or if there is no default selection
-
getDefaultProduct
The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS. Can be null.- Returns:
- the defaulted selection for this choice if the
targetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS, null otherwise or if there is no default selection
-
getDefaultVariant
The default variant that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS. Can be null.- Returns:
- the defaulted selection for this choice if the
targetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS, null otherwise or if there is no default selection
-
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.
-
getSpecificItemChoice
If thetargetTypeisDefaultItemChoiceTargetType.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 thetargetType
-
getPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()Summary of thepricing informationrelated to the choice.- Specified by:
getPriceInfoin interfacePriceable- Returns:
- The
PriceInfoon the entity.
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setChoiceKey
The key used during the validation of cart item's configuration to relate thisItemChoiceto one of the cart item's dependent items.- Parameters:
choiceKey- The key used during the validation of cart item's configuration to relate thisItemChoiceto one of the cart item's dependent items.
-
setPricingKey
System-wide unique identifier to configure specific pricing for the choice. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Parameters:
pricingKey- a unique key to identify this choice (usually a UUID)
-
setTargetType
Identifies the type of items that a customer can choose from, whether specific products, specific variants, or products from a specific category.- Parameters:
targetType- theDefaultItemChoiceTargetTypeof this item choice- See Also:
-
setDefaultProductInCategory
The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.CATEGORY.- Parameters:
defaultProduct- the default product that is automatically selected when thetargetTypeisDefaultItemChoiceTargetType.CATEGORY. Should come from within thecategory
-
setDefaultProduct
The default product that can be used when driving customer selections if thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_PRODUCTS. Can be null.- Parameters:
defaultProduct- the default product that is automatically selected when thetargetTypeis {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 thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS. Can be null.- Parameters:
defaultVariant- the default variant that is automatically selected when thetargetTypeisDefaultItemChoiceTargetType.SPECIFIC_VARIANTS. Should come from the explicit set of variants inspecificChoices
-
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
-
setSpecificChoices
If thetargetTypeisDefaultItemChoiceTargetType.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 thetargetTypeisDefaultItemChoiceTargetType.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
-
setPriceInfo
public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the choice.- Specified by:
setPriceInfoin interfacePriceable- Parameters:
priceInfo- ThePriceInfoto set.
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-