Class IncludedProduct
java.lang.Object
com.broadleafcommerce.cartoperation.domain.IncludedProduct
- All Implemented Interfaces:
Serializable
- Author:
- Chad Harchar (charchar)
- 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 booleanbooleancom.broadleafcommerce.cart.client.domain.AdditionalItemPricingReturn 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.Defines the display position of this included product in relation to other included products.getLabel()The user-facing label that describes this included product.javax.money.MonetaryAmountThis field contains the specified product if thetypeisIncludedProductType.PRODUCT.intThe value of the fixed quantity.getType()This field contains the specified variant if thetypeisIncludedProductType.VARIANT.This field contains the id of the parent product of the specifiedvariantif thetypeisIncludedProductType.VARIANT.inthashCode()booleanDictates whether or not discounts are allowed to be applied to this included product.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 included product.voidsetDisplayOrder(Long displayOrder) Defines the display position of this included product in relation to other included products.voidThe user-facing label that describes this included product.voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) voidsetPricingKey(String pricingKey) voidsetPricingTargetType(String pricingTargetType) voidsetProduct(Product product) This field contains the specified product if thetypeisIncludedProductType.PRODUCT.voidsetQuantity(int quantity) The value of the fixed quantity.voidvoidsetVariant(Variant variant) This field contains the specified variant if thetypeisIncludedProductType.VARIANT.voidsetVariantParentProductId(String variantParentProductId) This field contains the id of the parent product of the specifiedvariantif thetypeisIncludedProductType.VARIANT.toString()
-
Constructor Details
-
IncludedProduct
public IncludedProduct()
-
-
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.
-
getValidationKey
- Returns:
- The ID of the included item. By default, either the
productorvariantID.
-
getType
- Returns:
- the
IncludedProductTypeof this included product - See Also:
-
getLabel
The user-facing label that describes this included product.- Returns:
- the user-facing label that describes this included product
-
getDisplayOrder
Defines the display position of this included product in relation to other included products.- Returns:
- the order in which this included product should be displayed relative to other included products
-
getProduct
This field contains the specified product if thetypeisIncludedProductType.PRODUCT.- Returns:
- the product to use if this included product is of type
IncludedProductType.PRODUCT
-
getVariant
This field contains the specified variant if thetypeisIncludedProductType.VARIANT.- Returns:
- the variant to use if this included product is of type
IncludedProductType.VARIANT - See Also:
-
variantParentProductId
-
getVariantParentProductId
This field contains the id of the parent product of the specifiedvariantif thetypeisIncludedProductType.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
-
getAdditionalItemPricing
public com.broadleafcommerce.cart.client.domain.AdditionalItemPricing getAdditionalItemPricing() -
isDiscountAllowed
public boolean isDiscountAllowed()Dictates whether or not discounts are allowed to be applied to this included product.- Returns:
- true if discounts are allowed to be applied to this included product, false otherwise
-
getQuantity
public int getQuantity()The value of the fixed quantity.- Returns:
- the fixed quantity of the included product's target product(s) that can be added
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setType
- Parameters:
type- theIncludedProductTypeof this included product- See Also:
-
setLabel
The user-facing label that describes this included product.- Parameters:
label- the user-facing label that describes this included product
-
setDisplayOrder
Defines the display position of this included product in relation to other included products.- Parameters:
displayOrder- the order in which this included product should be displayed relative to other included products
-
setProduct
This field contains the specified product if thetypeisIncludedProductType.PRODUCT.- Parameters:
product- the product to use if this included product is of typeIncludedProductType.PRODUCT
-
setVariant
This field contains the specified variant if thetypeisIncludedProductType.VARIANT.- Parameters:
variant- the variant to use if this included product is of typeIncludedProductType.VARIANT- See Also:
-
variantParentProductId
-
setVariantParentProductId
This field contains the id of the parent product of the specifiedvariantif thetypeisIncludedProductType.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
-
setAdditionalItemPricing
public void setAdditionalItemPricing(com.broadleafcommerce.cart.client.domain.AdditionalItemPricing additionalItemPricing) -
setDiscountAllowed
public void setDiscountAllowed(boolean discountAllowed) Dictates whether or not discounts are allowed to be applied to this included product.- Parameters:
discountAllowed- true if discounts are allowed to be applied to this included product, false otherwise
-
setQuantity
public void setQuantity(int quantity) The value of the fixed quantity.- Parameters:
fixedQuantity- the fixed quantity of the included product's target product(s) that can be added
-
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
-