Class IncludedProduct
java.lang.Object
com.broadleafcommerce.cartoperation.domain.IncludedProduct
- All Implemented Interfaces:
Serializable
- 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.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.MonetaryAmount
This field contains the specified product if thetype
isIncludedProductType.PRODUCT
.int
The value of the fixed quantity.getType()
This field contains the specified variant if thetype
isIncludedProductType.VARIANT
.This field contains the id of the parent product of the specifiedvariant
if thetype
isIncludedProductType.VARIANT
.int
hashCode()
boolean
Dictates whether or not discounts are allowed to be applied to this included product.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 included product.void
setDisplayOrder
(Long displayOrder) Defines the display position of this included product in relation to other included products.void
The user-facing label that describes this included product.void
setOverridePrice
(javax.money.MonetaryAmount overridePrice) void
setPricingKey
(String pricingKey) void
setPricingTargetType
(String pricingTargetType) void
setProduct
(Product product) This field contains the specified product if thetype
isIncludedProductType.PRODUCT
.void
setQuantity
(int quantity) The value of the fixed quantity.void
void
setVariant
(Variant variant) This field contains the specified variant if thetype
isIncludedProductType.VARIANT
.void
setVariantParentProductId
(String variantParentProductId) This field contains the id of the parent product of the specifiedvariant
if thetype
isIncludedProductType.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
product
orvariant
ID.
-
getType
- Returns:
- the
IncludedProductType
of 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 thetype
isIncludedProductType.PRODUCT
.- Returns:
- the product to use if this included product is of type
IncludedProductType.PRODUCT
-
getVariant
This field contains the specified variant if thetype
isIncludedProductType.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 specifiedvariant
if thetype
isIncludedProductType.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
- theIncludedProductType
of 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 thetype
isIncludedProductType.PRODUCT
.- Parameters:
product
- the product to use if this included product is of typeIncludedProductType.PRODUCT
-
setVariant
This field contains the specified variant if thetype
isIncludedProductType.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 specifiedvariant
if thetype
isIncludedProductType.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
-