Class SpecificItemChoice
java.lang.Object
com.broadleafcommerce.cartoperation.domain.SpecificItemChoice
- All Implemented Interfaces:
Serializable
When a
ItemChoice
is determined to be a ItemChoiceTargetType.SPECIFIC_PRODUCTS
or
ItemChoiceTargetType.SPECIFIC_VARIANTS
, this holds the relationship that the customer
should select from- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
-
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.javax.money.MonetaryAmount
If thetype
isSpecificItemChoiceType.PRODUCT
this holds the product for this choicegetType()
Whether or not this item holds a product or a variant that the customer can select fromIf thetype
isSpecificItemChoiceType.VARIANT
this holds the variant for this choiceThis field contains the id of the parent product of the specifiedvariant
if thetype
isSpecificItemChoiceType.VARIANT
.Pricing overrides if specific variants of the main product this item belongs to are added to the cart.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
setDiscountAllowed
(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this add-on.void
setOverridePrice
(javax.money.MonetaryAmount overridePrice) void
setPricingKey
(String pricingKey) void
setPricingTargetType
(String pricingTargetType) void
setProduct
(Product product) If thetype
isSpecificItemChoiceType.PRODUCT
this holds the product for this choicevoid
Whether or not this item holds a product or a variant that the customer can select fromvoid
setVariant
(Variant variant) If thetype
isSpecificItemChoiceType.VARIANT
this holds the variant for this choicevoid
setVariantParentProductId
(String variantParentProductId) This field contains the id of the parent product of the specifiedvariant
if thetype
isSpecificItemChoiceType.VARIANT
.void
setVariantPricing
(Map<String, com.broadleafcommerce.cart.client.domain.SpecificItemChoiceVariantPricingOverride> variantPricing) Pricing overrides if specific variants of the main product this item belongs to are added to the cart.toString()
-
Constructor Details
-
SpecificItemChoice
public SpecificItemChoice()
-
-
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.
-
getType
Whether or not this item holds a product or a variant that the customer can select from- Returns:
- the type of this addon item
- See Also:
-
getProduct
If thetype
isSpecificItemChoiceType.PRODUCT
this holds the product for this choice- Returns:
- the product representing this choice, or null if
type
is notSpecificItemChoiceType.PRODUCT
-
getVariant
If thetype
isSpecificItemChoiceType.VARIANT
this holds the variant for this choice- Returns:
- the variant representing this choice, or null if
type
is notSpecificItemChoiceType.VARIANT
- See Also:
-
variantParentProductId
-
getVariantParentProductId
This field contains the id of the parent product of the specifiedvariant
if thetype
isSpecificItemChoiceType.VARIANT
.This field is necessary because variants are a sub-resource of product and thus API callers cannot fetch them purely by variant id alone.
- Returns:
- the id of the parent product of the
variant
- See Also:
-
variant
-
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() -
getVariantPricing
public Map<String,com.broadleafcommerce.cart.client.domain.SpecificItemChoiceVariantPricingOverride> getVariantPricing()Pricing overrides if specific variants of the main product this item belongs to are added to the cart.- Returns:
- Pricing overrides if specific variants of the main product are added to the cart.
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setType
Whether or not this item holds a product or a variant that the customer can select from- Parameters:
type
- the type of item this is, usually fromSpecificItemChoiceType
- See Also:
-
setProduct
If thetype
isSpecificItemChoiceType.PRODUCT
this holds the product for this choice- Parameters:
product
- the product representing this choice
-
setVariant
If thetype
isSpecificItemChoiceType.VARIANT
this holds the variant for this choice- Parameters:
variant
- the variant representing this choice- See Also:
-
variantParentProductId
-
setVariantParentProductId
This field contains the id of the parent product of the specifiedvariant
if thetype
isSpecificItemChoiceType.VARIANT
.This field is necessary because variants are a sub-resource of product and thus API callers cannot fetch them purely by variant id alone.
- Parameters:
variantParentProductId
- the id of the parent product of thevariant
- See Also:
-
variant
-
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) -
setVariantPricing
public void setVariantPricing(Map<String, com.broadleafcommerce.cart.client.domain.SpecificItemChoiceVariantPricingOverride> variantPricing) Pricing overrides if specific variants of the main product this item belongs to are added to the cart.- Parameters:
variantPricing
- Pricing overrides if specific variants of the main product are added to the cart.
-
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
-