Class IncludedProduct
java.lang.Object
com.broadleafcommerce.catalog.domain.product.IncludedProduct
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware,com.broadleafcommerce.translation.mapping.SubIdentifiable,Serializable
public class IncludedProduct
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware, com.broadleafcommerce.translation.mapping.SubIdentifiable
A
IncludedProduct represents a bundling of additional items with a parent product. For
configurable bundles to give the customer the ability to select multiple or have options, see
ProductOption- Author:
- Samarth Dhruva (samarthd), Phillip Verheyden (phillipuniverse)
- See Also:
-
Field Summary
Fields inherited from interface com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
DEFAULT_FIELD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionIncludedProduct(String id, String pricingKey, String type, String label, Long displayOrder, Product product, Variant variant, String variantParentProductId, javax.money.MonetaryAmount overridePrice, boolean discountAllowed, int quantity, com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState, IncludedProductAsset asset) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetAsset()The asset for this included product.com.broadleafcommerce.data.tracking.core.EmbeddedContextStateA subset ofTrackinginformation to expose the context state for this object.javax.money.MonetaryAmountGets the default price as appropriate for thetype.Defines the display position of this included product in relation to other included products.getId()getLabel()The user-facing label that describes this included product.javax.money.MonetaryAmountDeprecated.Deprecated.This field contains the specified product if theincluded product typeisIncludedProductType.PRODUCT.intIf thequantity typeof this included product isIncludedProductQuantityType#FIXED, this field will hold the 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()booleanDeprecated.voidsetAsset(IncludedProductAsset asset) The asset for this included product.voidsetContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetDiscountAllowed(boolean discountAllowed) Deprecated.voidsetDisplayOrder(Long displayOrder) Defines the display position of this included product in relation to other included products.voidvoidThe user-facing label that describes this included product.voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) Deprecated.voidsetPricingKey(String pricingKey) Deprecated.voidsetProduct(Product product) This field contains the specified product if theincluded product typeisIncludedProductType.PRODUCT.voidsetQuantity(int quantity) If thequantity typeof this included product isIncludedProductQuantityType#FIXED, this field will hold 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(String id, String pricingKey, String type, String label, Long displayOrder, Product product, Variant variant, String variantParentProductId, javax.money.MonetaryAmount overridePrice, boolean discountAllowed, int quantity, com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState, IncludedProductAsset asset) -
IncludedProduct
public IncludedProduct()
-
-
Method Details
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice()Gets the default price as appropriate for thetype.- Returns:
- The default price as appropriate for the
type.
-
getId
- Specified by:
getIdin interfacecom.broadleafcommerce.translation.mapping.SubIdentifiable- See Also:
-
SubIdentifiable.getId()
-
getPricingKey
Deprecated.Unique pricing key for this particular included product. Useful for scenarios such as pricing of included products, where a system wide unique identifier for the included product would be required to associate it with a price within an external system- Returns:
- a unique key to identify this included product
-
getType
Describes which of theproduct,variant, orcategory/default selectionfields should be used for this included product.- 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 theincluded product typeisIncludedProductType.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
-
getOverridePrice
Deprecated.The price of the included product itself. If no pricing is specified here, the price of the targetproduct,variant, or selected product from thecategorywill be used.- Returns:
- the price of this included product
-
isDiscountAllowed
Deprecated.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()If thequantity typeof this included product isIncludedProductQuantityType#FIXED, this field will hold the value of the fixed quantity.- Returns:
- the fixed quantity of the included product's target product(s) that can be added if
this included product's
quantity typeis ofIncludedProductQuantityType#FIXED
-
getContextState
public com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()A subset ofTrackinginformation to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetailsfor the parent object's entireattributesmap are compared.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
getAsset
The asset for this included product. Intended to override the asset normally shown for theproductspecifically in the context of this relationship.- Returns:
- asset information for this included product
- See Also:
-
setId
- Specified by:
setIdin interfacecom.broadleafcommerce.translation.mapping.SubIdentifiable- See Also:
-
SubIdentifiable.getId()
-
setPricingKey
Deprecated.Unique pricing key for this particular included product. Useful for scenarios such as pricing of included products, where a system wide unique identifier for the included product would be required to associate it with a price within an external system- Parameters:
pricingKey- a unique key to identify this included product (usually a UUID)
-
setType
Describes which of theproduct,variant, orcategory/default selectionfields should be used for this included product.- 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 theincluded product typeisIncludedProductType.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
-
setOverridePrice
Deprecated.The price of the included product itself. If no pricing is specified here, the price of the targetproduct,variant, or selected product from thecategorywill be used.- Parameters:
overridePrice- the price of this included product
-
setDiscountAllowed
Deprecated.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) If thequantity typeof this included product isIncludedProductQuantityType#FIXED, this field will hold the value of the fixed quantity.- Parameters:
fixedQuantity- the fixed quantity of the included product's target product(s) that can be added if this included product'squantity typeis ofIncludedProductQuantityType#FIXED
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTrackinginformation to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetailsfor the parent object's entireattributesmap are compared.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
setAsset
The asset for this included product. Intended to override the asset normally shown for theproductspecifically in the context of this relationship.- Parameters:
asset- asset information for this included product- See Also:
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-