Class IncludedProduct
- java.lang.Object
-
- com.broadleafcommerce.catalogbrowse.domain.IncludedProduct
-
- All Implemented Interfaces:
Priceable,Serializable
public class IncludedProduct extends Object implements Serializable, Priceable
AnIncludedItemrepresents a bundling of additional items with a parent product. For configurable bundles to give the customer the ability to select multiple or have options, seeProductOption- Author:
- Nathan Moore (nathandmoore)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IncludedProduct()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(String name, Object value)Takes in any additional attributes passed in the request not matching any defined properties.protected booleancanEqual(Object other)booleanequals(Object o)Map<String,Object>getAttribute()Return any additional attributes passed in the request not matching any defined properties.Map<String,Object>getAttributes()Map holding any additional attributes passed in the request not matching any defined properties.javax.money.MonetaryAmountgetOverridePrice()com.broadleafcommerce.pricing.client.domain.PriceInfogetPriceInfo()Summary of thepricing informationrelated to the included item.StringgetPricingKey()Unique pricing key for this particular included item.ProductgetProduct()This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.intgetQuantity()Fixed quantity of the item that is included with the parent product.StringgetType()Defines the type of the item: usually a Product or Variant.VariantgetVariant()This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.StringgetVendorRef()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)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.voidsetType(String type)Defines the type of the item: usually a Product or Variant.voidsetVariant(Variant variant)This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.StringtoString()
-
-
-
Method Detail
-
addAttribute
public void addAttribute(String name, Object value)
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
public Map<String,Object> 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
@Nullable public String getVendorRef()
-
getPricingKey
public String 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
public String getType()
Defines the type of the item: usually a Product or Variant.- Returns:
- the type of the item
- See Also:
DefaultIncludedProductType
-
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
public 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
public Variant 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
public Map<String,Object> getAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.
-
setPricingKey
public void setPricingKey(String pricingKey)
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
public void setType(String type)
Defines the type of the item: usually a Product or Variant.- Parameters:
type- the type of the item- See Also:
DefaultIncludedProductType
-
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
public void setProduct(Product product)
This field contains the specified product if thetypeisDefaultIncludedProductType.PRODUCT.- Parameters:
product- the product to use if this included product is of typeDefaultIncludedProductType.PRODUCT
-
setVariant
public void setVariant(Variant variant)
This field contains the specified variant if thetypeisDefaultIncludedProductType.VARIANT.- Parameters:
variant- the variant to use if this included product is of typeDefaultIncludedProductType.VARIANT
-
setAttributes
public void setAttributes(Map<String,Object> attributes)
Map holding any additional attributes passed in the request not matching any defined properties.
-
canEqual
protected boolean canEqual(Object other)
-
-