Class Product
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.domain.Product
-
- All Implemented Interfaces:
com.broadleafcommerce.money.jackson.CurrencyContextAware
,Serializable
public class Product extends Object implements Serializable, com.broadleafcommerce.money.jackson.CurrencyContextAware
A reference to a product, typically used as a holder for information communicated from an external service.- Author:
- Chad Harchar (charchar)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Product()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalAttribute(String name, Object value)
Takes in any additional attributes passed in the request not matching any defined properties.protected boolean
canEqual(Object other)
boolean
equals(Object o)
Map<String,Object>
getAdditionalAttribute()
Return any additional attributes passed in the request not matching any defined properties.Map<String,Object>
getAdditionalAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.List<ProductTag>
getAdvancedTags()
A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.List<String>
getAllTags()
List<com.broadleafcommerce.cart.client.domain.ImageAssetRef>
getAssets()
AllProductAssets
for this product.Map<String,Attribute>
getAttributes()
Dynamic attributes that are a part of the product.DataDrivenEnum
getBrand()
javax.money.CurrencyUnit
getCurrency()
com.broadleafcommerce.money.CurrencyContext
getCurrencyContext()
Transient ability to have a currency initializedMap<String,FulfillmentFlatRate>
getFulfillmentFlatRates()
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping).String
getId()
The ID of the Product.List<IncludedProduct>
getIncludedProducts()
Additional products that are always included with the product, no matter what.String
getInventoryCheckStrategy()
Describes when the product's inventory should be checked for availability.String
getInventoryReservationStrategy()
Describes when the product's inventory should be reserved.String
getInventoryType()
Describes the product's type of fulfillment - ie is it a physical or virtual item?Integer
getMaximumThreshold()
The maximum count of this product that must be added in a cart.DataDrivenEnum
getMerchandisingType()
String
getMergingType()
Determines how this Product should merge with other similar items when it gets added to a cart.Integer
getMinimumThreshold()
The minimum count of this product that must be added in a cart.String
getName()
The name of the product.List<ProductOption>
getOptions()
Drives additional information that the customer should enter when purchasing this product.Set<Category>
getParentCategories()
AllCategories
that include the product.com.broadleafcommerce.pricing.client.domain.PriceInfo
getPriceInfo()
Summary of thepricing information
related to the product.String
getPricingKey()
System-wide unique identifier to configure specific pricing for the product.com.broadleafcommerce.cart.client.domain.ImageAssetRef
getPrimaryAsset()
The asset associated with this product marked as primary.String
getProductType()
Defines the type of the product.String
getSku()
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.List<String>
getTags()
A list of simple labels used to categorize the productDataDrivenEnum
getTargetDemographic()
String
getUri()
The navigable uri of this product.List<Variant>
getVariants()
AllVariants
for this product.String
getVendorRef()
Soft reference to the vendor associated with this catalog.Weight
getWeight()
int
hashCode()
boolean
isAvailableOnline()
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.boolean
isDiscountable()
Whether or not this product be applied to any offers or promotions.boolean
isIndividuallySold()
If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.void
setAdditionalAttributes(Map<String,Object> additionalAttributes)
Map holding any additional attributes passed in the request not matching any defined properties.void
setAdvancedTags(List<ProductTag> advancedTags)
A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.void
setAssets(List<com.broadleafcommerce.cart.client.domain.ImageAssetRef> assets)
AllProductAssets
for this product.void
setAttributes(Map<String,Attribute> attributes)
Dynamic attributes that are a part of the product.void
setAvailableOnline(boolean availableOnline)
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.void
setBrand(DataDrivenEnum brand)
void
setCurrencyContext(com.broadleafcommerce.money.CurrencyContext currencyContext)
Transient ability to have a currency initializedvoid
setDiscountable(boolean discountable)
Whether or not this product be applied to any offers or promotions.void
setFulfillmentFlatRates(Map<String,FulfillmentFlatRate> fulfillmentFlatRates)
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping).void
setId(String id)
The ID of the Product.void
setIncludedProducts(List<IncludedProduct> includedProducts)
Additional products that are always included with the product, no matter what.void
setIndividuallySold(boolean individuallySold)
If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.void
setInventoryCheckStrategy(String inventoryCheckStrategy)
Describes when the product's inventory should be checked for availability.void
setInventoryReservationStrategy(String inventoryReservationStrategy)
Describes when the product's inventory should be reserved.void
setInventoryType(String inventoryType)
Describes the product's type of fulfillment - ie is it a physical or virtual item?void
setMaximumThreshold(Integer maximumThreshold)
The maximum count of this product that must be added in a cart.void
setMerchandisingType(DataDrivenEnum merchandisingType)
void
setMergingType(String mergingType)
Determines how this Product should merge with other similar items when it gets added to a cart.void
setMinimumThreshold(Integer minimumThreshold)
The minimum count of this product that must be added in a cart.void
setName(String name)
The name of the product.void
setOptions(List<ProductOption> options)
Drives additional information that the customer should enter when purchasing this product.void
setParentCategories(Set<Category> parentCategories)
AllCategories
that include the product.void
setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
Summary of thepricing information
related to the product.void
setPricingKey(String pricingKey)
System-wide unique identifier to configure specific pricing for the product.void
setPrimaryAsset(com.broadleafcommerce.cart.client.domain.ImageAssetRef primaryAsset)
The asset associated with this product marked as primary.void
setProductType(String productType)
Defines the type of the product.void
setSku(String sku)
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.void
setTags(List<String> tags)
A list of simple labels used to categorize the productvoid
setTargetDemographic(DataDrivenEnum targetDemographic)
void
setUri(String uri)
The navigable uri of this product.void
setVariants(List<Variant> variants)
AllVariants
for this product.void
setVendorRef(String vendorRef)
Soft reference to the vendor associated with this catalog.void
setWeight(Weight weight)
String
toString()
-
-
-
Method Detail
-
addAdditionalAttribute
public void addAdditionalAttribute(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
-
getAdditionalAttribute
public Map<String,Object> getAdditionalAttribute()
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.
-
getCurrency
public javax.money.CurrencyUnit getCurrency()
-
getId
public String getId()
The ID of the Product.- Returns:
- The ID of the Product.
-
getName
public String getName()
The name of the product.- Returns:
- The name of the product.
-
getUri
public String getUri()
The navigable uri of this product.- Returns:
- The navigable uri of this product.
-
getSku
public String getSku()
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.- Returns:
- the Stock Keeping Unit identifier which means that this Product is sold in the store
-
isDiscountable
public boolean isDiscountable()
Whether or not this product be applied to any offers or promotions.
Defaults to
true
- Returns:
- whether or not this product can be applied to any offers or promotions
-
getPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()
Summary of thepricing information
related to the product.- Returns:
- Summary of the
pricing information
related to the product
-
getPricingKey
public String getPricingKey()
System-wide unique identifier to configure specific pricing for the product. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Returns:
- a unique key to identify this product
-
getMergingType
public String getMergingType()
Determines how this Product should merge with other similar items when it gets added to a cart. This will override the global setting on item merging. Out of box supported values are those inDefaultMergingType
.- Returns:
- the merging type to use for this Product
-
getFulfillmentFlatRates
public Map<String,FulfillmentFlatRate> getFulfillmentFlatRates()
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping). Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this product.The key of the map is the type of the fulfillment option such as
FIXED_STANDARD
orBANDED_PRICE_EXPRESS
.- Returns:
- Map of Fulfillment option types to flat rates for this product.
- See Also:
FulfillmentFlatRate
-
getIncludedProducts
public List<IncludedProduct> getIncludedProducts()
Additional products that are always included with the product, no matter what. Used to configure "bundles" or "kits".
If some of these items should be optional or the user should decide which additional items are added to their cart, use
options
instead.- Returns:
- additional products that bundle with this product as their parent
- See Also:
IncludedProduct
-
getPrimaryAsset
public com.broadleafcommerce.cart.client.domain.ImageAssetRef getPrimaryAsset()
The asset associated with this product marked as primary.- Returns:
- The primary asset for this product.
-
getAssets
public List<com.broadleafcommerce.cart.client.domain.ImageAssetRef> getAssets()
AllProductAssets
for this product.- Returns:
- All
ProductAssets
for this product.
-
getAttributes
public Map<String,Attribute> getAttributes()
Dynamic attributes that are a part of the product.- Returns:
- dynamic attributes that are a part of the product
-
getOptions
public List<ProductOption> getOptions()
Drives additional information that the customer should enter when purchasing this product. this can be in the form of additionalvariations
, additional items that can be bundled with this product or simply more information that the customer needs to enter about what they are purchasing (like a personalized message).- Returns:
- Different options that the user can configure to further refine their purchase.
-
getInventoryType
public String getInventoryType()
Describes the product's type of fulfillment - ie is it a physical or virtual item?- Returns:
- the product's type of inventory
-
isAvailableOnline
public boolean isAvailableOnline()
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.- Returns:
- Whether or not this product is available online.
-
getInventoryCheckStrategy
public String getInventoryCheckStrategy()
Describes when the product's inventory should be checked for availability.- Returns:
- the product's inventory check strategy
-
getInventoryReservationStrategy
public String getInventoryReservationStrategy()
Describes when the product's inventory should be reserved.- Returns:
- the product's inventory reservation strategy
-
getTags
public List<String> getTags()
A list of simple labels used to categorize the product- Returns:
- a list of simple labels used to categorize the product
-
getParentCategories
public Set<Category> getParentCategories()
AllCategories
that include the product.- Returns:
- All
Categories
that include the product.
-
getVariants
public List<Variant> getVariants()
AllVariants
for this product.- Returns:
- All
Variants
for this product.
-
getWeight
public Weight getWeight()
- Returns:
- the weight of this product
-
isIndividuallySold
public boolean isIndividuallySold()
If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.
This defaults to
true
.- Returns:
- whether or not this product or any of its variants can be sold individually
-
getCurrencyContext
public com.broadleafcommerce.money.CurrencyContext getCurrencyContext()
Transient ability to have a currency initialized- Specified by:
getCurrencyContext
in interfacecom.broadleafcommerce.money.jackson.CurrencyContextAware
-
getVendorRef
public String getVendorRef()
Soft reference to the vendor associated with this catalog. This value can be null, in which case, no vendor is associated.- Returns:
- Soft reference to the vendor associated with this catalog.
-
getProductType
public String getProductType()
Defines the type of the product. This value is added to theinternalAttributes
under theCartItemAttributeConstants.Internal.PRODUCT_TYPE
key and used to determine the product type for theCartItem
. The default types are defined byDefaultProductType
.- Returns:
- The type of the product
- See Also:
DefaultProductType
-
getBrand
public DataDrivenEnum getBrand()
- Returns:
- the brand of this product
-
getMerchandisingType
public DataDrivenEnum getMerchandisingType()
- Returns:
- the merchandising type of this product
-
getTargetDemographic
public DataDrivenEnum getTargetDemographic()
- Returns:
- the target demographic of this product
-
getAdditionalAttributes
public Map<String,Object> getAdditionalAttributes()
Map holding any additional attributes passed in the request not matching any defined properties.
-
getMinimumThreshold
public Integer getMinimumThreshold()
The minimum count of this product that must be added in a cart.- Returns:
- the minimum count of this product that must be added in a cart
-
getMaximumThreshold
public Integer getMaximumThreshold()
The maximum count of this product that must be added in a cart.- Returns:
- the maximum count of this product that must be added in a cart
-
getAdvancedTags
public List<ProductTag> getAdvancedTags()
A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.- Returns:
- A list of
ProductTags
.
-
setId
public void setId(String id)
The ID of the Product.- Parameters:
id
- The ID of the Product.
-
setName
public void setName(String name)
The name of the product.- Parameters:
name
- The name of the product.
-
setUri
public void setUri(String uri)
The navigable uri of this product.- Parameters:
uri
- The navigable uri of this product.
-
setSku
public void setSku(String sku)
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.- Parameters:
sku
- the Stock Keeping Unit identifier for this Product. Typically only set this if intending to sell this single Product in the store, but can also be set to the same value as a relatedvariant's
sku to declare a default variant/default sku for the product
-
setDiscountable
public void setDiscountable(boolean discountable)
Whether or not this product be applied to any offers or promotions.
Defaults to
true
- Parameters:
discountable
- whether or not this product can be applied to any offers or promotions
-
setPriceInfo
public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
Summary of thepricing information
related to the product.- Parameters:
priceInfo
- Summary of thepricing information
related to the product
-
setPricingKey
public void setPricingKey(String pricingKey)
System-wide unique identifier to configure specific pricing for the product. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Parameters:
pricingKey
- a unique key to identify this product (usually a UUID)
-
setMergingType
public void setMergingType(String mergingType)
Determines how this Product should merge with other similar items when it gets added to a cart. This will override the global setting on item merging. Out of box supported values are those inDefaultMergingType
.- Parameters:
mergingType
- the merging type to use for this Product
-
setFulfillmentFlatRates
public void setFulfillmentFlatRates(Map<String,FulfillmentFlatRate> fulfillmentFlatRates)
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping). Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this product.The key of the map is the type of the fulfillment option such as
FIXED_STANDARD
orBANDED_PRICE_EXPRESS
.- Parameters:
fulfillmentFlatRates
- Map of Fulfillment option types to flat rates for this product.- See Also:
FulfillmentFlatRate
-
setIncludedProducts
public void setIncludedProducts(List<IncludedProduct> includedProducts)
Additional products that are always included with the product, no matter what. Used to configure "bundles" or "kits".
If some of these items should be optional or the user should decide which additional items are added to their cart, use
options
instead.- Parameters:
includedProducts
- that bundle with this product as their parent- See Also:
IncludedProduct
-
setPrimaryAsset
public void setPrimaryAsset(com.broadleafcommerce.cart.client.domain.ImageAssetRef primaryAsset)
The asset associated with this product marked as primary.- Parameters:
primaryAsset
- The primary asset for this product.
-
setAssets
public void setAssets(List<com.broadleafcommerce.cart.client.domain.ImageAssetRef> assets)
AllProductAssets
for this product.- Parameters:
assets
- AllProductAssets
for this product.
-
setAttributes
public void setAttributes(Map<String,Attribute> attributes)
Dynamic attributes that are a part of the product.- Parameters:
attributes
- dynamic attributes that are a part of the product
-
setOptions
public void setOptions(List<ProductOption> options)
Drives additional information that the customer should enter when purchasing this product. this can be in the form of additionalvariations
, additional items that can be bundled with this product or simply more information that the customer needs to enter about what they are purchasing (like a personalized message).- Parameters:
options
- the options for this product
-
setInventoryType
public void setInventoryType(String inventoryType)
Describes the product's type of fulfillment - ie is it a physical or virtual item?- Parameters:
inventoryType
- a String representation of the product's type of inventory
-
setAvailableOnline
public void setAvailableOnline(boolean availableOnline)
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.- Parameters:
availableOnline
- Whether or not this product is available online.
-
setInventoryCheckStrategy
public void setInventoryCheckStrategy(String inventoryCheckStrategy)
Describes when the product's inventory should be checked for availability.- Parameters:
inventoryCheckStrategy
- the product's inventory check strategy
-
setInventoryReservationStrategy
public void setInventoryReservationStrategy(String inventoryReservationStrategy)
Describes when the product's inventory should be reserved.- Parameters:
inventoryReservationStrategy
- the product's inventory reservation strategy
-
setTags
public void setTags(List<String> tags)
A list of simple labels used to categorize the product- Parameters:
tags
- a list of simple labels used to categorize the product
-
setParentCategories
public void setParentCategories(Set<Category> parentCategories)
AllCategories
that include the product.- Parameters:
parentCategories
- AllCategories
that include the product.
-
setVariants
public void setVariants(List<Variant> variants)
AllVariants
for this product.- Parameters:
variants
- AllVariants
for this product.
-
setWeight
public void setWeight(Weight weight)
- Parameters:
weight
- the weight of this product
-
setIndividuallySold
public void setIndividuallySold(boolean individuallySold)
If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.
This defaults to
true
.- Parameters:
individuallySold
- whether or not this product or any of its variants can be sold individually
-
setCurrencyContext
public void setCurrencyContext(com.broadleafcommerce.money.CurrencyContext currencyContext)
Transient ability to have a currency initialized- Specified by:
setCurrencyContext
in interfacecom.broadleafcommerce.money.jackson.CurrencyContextAware
-
setVendorRef
public void setVendorRef(String vendorRef)
Soft reference to the vendor associated with this catalog. This value can be null, in which case, no vendor is associated.- Parameters:
vendorRef
- Soft reference to the vendor associated with this catalog.
-
setProductType
public void setProductType(String productType)
Defines the type of the product. This value is added to theinternalAttributes
under theCartItemAttributeConstants.Internal.PRODUCT_TYPE
key and used to determine the product type for theCartItem
. The default types are defined byDefaultProductType
.- Parameters:
productType
- The type of the product- See Also:
DefaultProductType
-
setBrand
public void setBrand(DataDrivenEnum brand)
- Parameters:
brand
- the brand of this product
-
setMerchandisingType
public void setMerchandisingType(DataDrivenEnum merchandisingType)
- Parameters:
merchandisingType
- the merchandising type of this product
-
setTargetDemographic
public void setTargetDemographic(DataDrivenEnum targetDemographic)
- Parameters:
targetDemographic
- the target demographic of this product
-
setAdditionalAttributes
public void setAdditionalAttributes(Map<String,Object> additionalAttributes)
Map holding any additional attributes passed in the request not matching any defined properties.
-
setMinimumThreshold
public void setMinimumThreshold(Integer minimumThreshold)
The minimum count of this product that must be added in a cart.- Parameters:
minimumThreshold
- the minimum count of this product that must be added in a cart
-
setMaximumThreshold
public void setMaximumThreshold(Integer maximumThreshold)
The maximum count of this product that must be added in a cart.- Parameters:
maximumThreshold
- the maximum count of this product that must be added in a cart
-
setAdvancedTags
public void setAdvancedTags(List<ProductTag> advancedTags)
A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.- Parameters:
advancedTags
- A list ofProductTags
.
-
canEqual
protected boolean canEqual(Object other)
-
-