Class SpecificItemChoice
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.domain.SpecificItemChoice
-
- All Implemented Interfaces:
Serializable
public class SpecificItemChoice extends Object implements Serializable
When aItemChoiceis determined to be aItemChoiceTargetType.SPECIFIC_PRODUCTSorItemChoiceTargetType.SPECIFIC_VARIANTS, this holds the relationship that the customer should select from- Author:
- Chad Harchar (charchar)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpecificItemChoice()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(String name, Object value)Takes in any additional attributes passed in the request not matching any defined properties.protected booleancanEqual(Object other)booleanequals(Object o)com.broadleafcommerce.cart.client.domain.AdditionalItemPricinggetAdditionalItemPricing()Map<String,Object>getAttribute()Return any additional attributes passed in the request not matching any defined properties.Map<String,Object>getAttributes()Map holding any additional attributes passed in the request not matching any defined properties.javax.money.MonetaryAmountgetOverridePrice()StringgetPricingKey()StringgetPricingTargetType()ProductgetProduct()If thetypeisSpecificItemChoiceType.PRODUCTthis holds the product for this choiceStringgetType()Whether or not this item holds a product or a variant that the customer can select fromVariantgetVariant()If thetypeisSpecificItemChoiceType.VARIANTthis holds the variant for this choiceStringgetVariantParentProductId()This field contains the id of the parent product of the specifiedvariantif thetypeisSpecificItemChoiceType.VARIANT.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.inthashCode()booleanisDiscountAllowed()Dictates whether or not discounts are allowed to be applied to this add-on.voidsetAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing)voidsetAttributes(Map<String,Object> attributes)Map holding any additional attributes passed in the request not matching any defined properties.voidsetDiscountAllowed(boolean discountAllowed)Dictates whether or not discounts are allowed to be applied to this add-on.voidsetOverridePrice(javax.money.MonetaryAmount overridePrice)voidsetPricingKey(String pricingKey)voidsetPricingTargetType(String pricingTargetType)voidsetProduct(Product product)If thetypeisSpecificItemChoiceType.PRODUCTthis holds the product for this choicevoidsetType(String type)Whether or not this item holds a product or a variant that the customer can select fromvoidsetVariant(Variant variant)If thetypeisSpecificItemChoiceType.VARIANTthis holds the variant for this choicevoidsetVariantParentProductId(String variantParentProductId)This field contains the id of the parent product of the specifiedvariantif thetypeisSpecificItemChoiceType.VARIANT.voidsetVariantPricing(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.StringtoString()
-
-
-
Method Detail
-
addAttribute
public void addAttribute(String name, Object value)
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
public Map<String,Object> 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
public String 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:
SpecificItemChoiceType
-
getProduct
public Product getProduct()
If thetypeisSpecificItemChoiceType.PRODUCTthis holds the product for this choice- Returns:
- the product representing this choice, or null if
typeis notSpecificItemChoiceType.PRODUCT
-
getVariant
public Variant getVariant()
If thetypeisSpecificItemChoiceType.VARIANTthis holds the variant for this choice- Returns:
- the variant representing this choice, or null if
typeis notSpecificItemChoiceType.VARIANT - See Also:
variantParentProductId
-
getVariantParentProductId
public String getVariantParentProductId()
This field contains the id of the parent product of the specifiedvariantif thetypeisSpecificItemChoiceType.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.
-
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
public Map<String,Object> getAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.
-
setType
public void setType(String type)
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:
SpecificItemChoiceType
-
setProduct
public void setProduct(Product product)
If thetypeisSpecificItemChoiceType.PRODUCTthis holds the product for this choice- Parameters:
product- the product representing this choice
-
setVariant
public void setVariant(Variant variant)
If thetypeisSpecificItemChoiceType.VARIANTthis holds the variant for this choice- Parameters:
variant- the variant representing this choice- See Also:
variantParentProductId
-
setVariantParentProductId
public void setVariantParentProductId(String variantParentProductId)
This field contains the id of the parent product of the specifiedvariantif thetypeisSpecificItemChoiceType.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.
-
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
public void setAttributes(Map<String,Object> attributes)
Map holding any additional attributes passed in the request not matching any defined properties.
-
canEqual
protected boolean canEqual(Object other)
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice()
-
getPricingKey
public String getPricingKey()
-
getPricingTargetType
public String getPricingTargetType()
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice)
-
setPricingKey
public void setPricingKey(String pricingKey)
-
setPricingTargetType
public void setPricingTargetType(String pricingTargetType)
-
-