Class IncludedProduct
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.IncludedProduct
- All Implemented Interfaces:
Priceable,Serializable
An
IncludedItem 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:
- Nathan Moore (nathandmoore)
- 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 booleanbooleanReturn 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.javax.money.MonetaryAmountThe specific price set for this included item that overrides the price of underlyingproductorvariant.com.broadleafcommerce.pricing.client.domain.PriceInfoSummary of thepricing informationrelated to the included item.Unique pricing key for this particular included item.This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.intFixed quantity of the item that is included with the parent product.getType()Defines the type of the item: usually a Product or Variant.This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.inthashCode()voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetOverridePrice(javax.money.MonetaryAmount overridePrice) The specific price set for this included item that overrides the price of underlyingproductorvariant.voidsetPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the included item.voidsetPricingKey(String pricingKey) Unique pricing key for this particular included item.voidsetProduct(Product product) This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.voidsetQuantity(int quantity) Fixed quantity of the item that is included with the parent product.voidDefines the type of the item: usually a Product or Variant.voidsetVariant(Variant variant) This field contains the specified variant if thetypeisDefaultIncludedProductType.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.
-
getVendorRef
-
getPricingKey
Unique pricing key for this particular included item. Useful for scenarios such as pricing of included items, where a system wide unique identifier for the included item would be required to associate it with a price within an external system- Returns:
- a unique key to identify this included item
-
getType
Defines the type of the item: usually a Product or Variant.- Returns:
- the type of the item
- See Also:
-
getPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()Summary of thepricing informationrelated to the included item. The consumer of this service is expecting this to be the source of truth for the pricing of this item, so this field should be calculated from its own override price if present or be a copy of the underlying product's or variant's pricing to simplify the consumer's logic.- Specified by:
getPriceInfoin interfacePriceable- Returns:
- The
PriceInfoon the entity. - See Also:
-
for special pricing considerations
-
getOverridePrice
public javax.money.MonetaryAmount getOverridePrice()The specific price set for this included item that overrides the price of underlyingproductorvariant. This is primarily used for reference in determining whetherpriceInfoshould be disregarded in pricing calculations in this service: If there is anoverridePrice, then thepriceInforeceived from theCatalogProvidershould be used as the base for additional pricing calculations informed by thePricingProvider. Otherwise, the receivedpriceInfoshould be discarded since it is really a copy of the underlyingproductorvariantand cannot be used as a basis for additional pricing calculations for theIncludedProductitself.- Returns:
- the price of this included product
-
getQuantity
public int getQuantity()Fixed quantity of the item that is included with the parent product.- Returns:
- Fixed quantity of the item that is included with the parent product.
-
getProduct
This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.- Returns:
- the product to use if this included product is of type
DefaultIncludedProductType.PRODUCT
-
getVariant
This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.- Returns:
- the variant to use if this included product is of type
DefaultIncludedProductType.VARIANT
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setPricingKey
Unique pricing key for this particular included item. Useful for scenarios such as pricing of included items, where a system wide unique identifier for the included item would be required to associate it with a price within an external system- Parameters:
pricingKey- a unique key to identify this included item (usually a UUID)
-
setType
Defines the type of the item: usually a Product or Variant.- Parameters:
type- the type of the item- See Also:
-
setPriceInfo
public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the included item. The consumer of this service is expecting this to be the source of truth for the pricing of this item, so this field should be calculated from its own override price if present or be a copy of the underlying product's or variant's pricing to simplify the consumer's logic.- Specified by:
setPriceInfoin interfacePriceable- Parameters:
priceInfo- ThePriceInfoto set.- See Also:
-
for special pricing considerations
-
setOverridePrice
public void setOverridePrice(javax.money.MonetaryAmount overridePrice) The specific price set for this included item that overrides the price of underlyingproductorvariant. This is primarily used for reference in determining whetherpriceInfoshould be disregarded in pricing calculations in this service: If there is anoverridePrice, then thepriceInforeceived from theCatalogProvidershould be used as the base for additional pricing calculations informed by thePricingProvider. Otherwise, the receivedpriceInfoshould be discarded since it is really a copy of the underlyingproductorvariantand cannot be used as a basis for additional pricing calculations for theIncludedProductitself.- Parameters:
overridePrice- the price of this included product
-
setQuantity
public void setQuantity(int quantity) Fixed quantity of the item that is included with the parent product.- Parameters:
quantity- Fixed quantity of the item that is included with the parent product.
-
setProduct
This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.- Parameters:
product- the product to use if this included product is of typeDefaultIncludedProductType.PRODUCT
-
setVariant
This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.- Parameters:
variant- the variant to use if this included product is of typeDefaultIncludedProductType.VARIANT
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-