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
ConstructorDescriptionIncludedProduct
(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 boolean
boolean
getAsset()
The asset for this included product.com.broadleafcommerce.data.tracking.core.EmbeddedContextState
A subset ofTracking
information to expose the context state for this object.javax.money.MonetaryAmount
Gets 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.MonetaryAmount
Deprecated.Deprecated.This field contains the specified product if theincluded product type
isIncludedProductType.PRODUCT
.int
If thequantity type
of this included product isIncludedProductQuantityType#FIXED
, this field will hold 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
Deprecated.void
setAsset
(IncludedProductAsset asset) The asset for this included product.void
setContextState
(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setDiscountAllowed
(boolean discountAllowed) Deprecated.void
setDisplayOrder
(Long displayOrder) Defines the display position of this included product in relation to other included products.void
void
The user-facing label that describes this included product.void
setOverridePrice
(javax.money.MonetaryAmount overridePrice) Deprecated.void
setPricingKey
(String pricingKey) Deprecated.void
setProduct
(Product product) This field contains the specified product if theincluded product type
isIncludedProductType.PRODUCT
.void
setQuantity
(int quantity) If thequantity type
of this included product isIncludedProductQuantityType#FIXED
, this field will hold 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(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:
getId
in 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 selection
fields should be used for this included product.- 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 theincluded product type
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
-
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 thecategory
will 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 type
of 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 type
is ofIncludedProductQuantityType#FIXED
-
getContextState
public com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()A subset ofTracking
information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetails
for the parent object's entireattributes
map are compared.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
getAsset
The asset for this included product. Intended to override the asset normally shown for theproduct
specifically in the context of this relationship.- Returns:
- asset information for this included product
- See Also:
-
setId
- Specified by:
setId
in 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 selection
fields should be used for this included product.- 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 theincluded product type
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
-
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 thecategory
will 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 type
of 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 type
is ofIncludedProductQuantityType#FIXED
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState) A subset ofTracking
information to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetails
for the parent object's entireattributes
map are compared.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
setAsset
The asset for this included product. Intended to override the asset normally shown for theproduct
specifically in the context of this relationship.- Parameters:
asset
- asset information for this included product- See Also:
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-