Class Product
- All Implemented Interfaces:
CatalogItem
,com.broadleafcommerce.money.jackson.CurrencyContextAware
- Author:
- Chad Harchar (charchar)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalAttribute
(String name, Object value) Takes in any additional attributes passed in the request not matching any defined properties.protected boolean
boolean
Return 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.A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.List<com.broadleafcommerce.cart.client.domain.ImageAssetRef>
AllProductAssets
for this product.Dynamic attributes that are a part of the product.getBrand()
javax.money.CurrencyUnit
com.broadleafcommerce.money.CurrencyContext
Transient ability to have a currency initializedA map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping).getId()
The ID of the Product.Additional products that are always included with the product, no matter what.Describes when the product's inventory should be checked for availability.Describes when the product's inventory should be reserved.Describes the product's type of fulfillment - ie is it a physical or virtual item?The maximum count of this product that must be added in a cart.Determines how this Product should merge with other similar items when it gets added to a cart.The minimum count of this product that must be added in a cart.getName()
The name of the product.Drives additional information that the customer should enter when purchasing this product.AllCategories
that include the product.com.broadleafcommerce.pricing.client.domain.PriceInfo
Summary of thepricing information
related to the product.System-wide unique identifier to configure specific pricing for the product.com.broadleafcommerce.cart.client.domain.ImageAssetRef
The asset associated with this product marked as primary.Defines the type of the product.getSku()
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.getTags()
A list of simple labels used to categorize the productgetUri()
The navigable uri of this product.AllVariants
for this product.Soft reference to the vendor associated with this catalog.int
hashCode()
boolean
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.boolean
Whether or not this product be applied to any offers or promotions.boolean
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
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
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
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
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.void
A list of simple labels used to categorize the productvoid
setTargetDemographic
(DataDrivenEnum targetDemographic) void
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
toString()
-
Constructor Details
-
Product
public Product()
-
-
Method Details
-
getAllTags
-
addAdditionalAttribute
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
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
The ID of the Product.- Specified by:
getId
in interfaceCatalogItem
- Returns:
- The ID of the Product.
-
getName
The name of the product.- Returns:
- The name of the product.
-
getUri
The navigable uri of this product.- Returns:
- The navigable uri of this product.
-
getSku
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.- Specified by:
getSku
in interfaceCatalogItem
- 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.- Specified by:
getPriceInfo
in interfaceCatalogItem
- Returns:
- Summary of the
pricing information
related to the product
-
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.- Specified by:
getPricingKey
in interfaceCatalogItem
- Returns:
- a unique key to identify this product
-
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
.- Specified by:
getMergingType
in interfaceCatalogItem
- Returns:
- the merging type to use for this Product
-
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:
-
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:
-
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
AllProductAssets
for this product.- Returns:
- All
ProductAssets
for this product.
-
getAttributes
Dynamic attributes that are a part of the product.- Returns:
- dynamic attributes that are a part of the product
-
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
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
Describes when the product's inventory should be checked for availability.- Returns:
- the product's inventory check strategy
-
getInventoryReservationStrategy
Describes when the product's inventory should be reserved.- Returns:
- the product's inventory reservation strategy
-
getTags
A list of simple labels used to categorize the product- Returns:
- a list of simple labels used to categorize the product
-
getParentCategories
AllCategories
that include the product.- Returns:
- All
Categories
that include the product.
-
getVariants
AllVariants
for this product.- Returns:
- All
Variants
for this product.
-
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
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
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:
-
getBrand
- Returns:
- the brand of this product
-
getMerchandisingType
- Returns:
- the merchandising type of this product
-
getTargetDemographic
- Returns:
- the target demographic of this product
-
getAdditionalAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
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
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
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
The ID of the Product.- Parameters:
id
- The ID of the Product.
-
setName
The name of the product.- Parameters:
name
- The name of the product.
-
setUri
The navigable uri of this product.- Parameters:
uri
- The navigable uri of this product.
-
setSku
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
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
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
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:
-
setIncludedProducts
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:
-
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
AllProductAssets
for this product.- Parameters:
assets
- AllProductAssets
for this product.
-
setAttributes
Dynamic attributes that are a part of the product.- Parameters:
attributes
- dynamic attributes that are a part of the product
-
setOptions
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
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
Describes when the product's inventory should be checked for availability.- Parameters:
inventoryCheckStrategy
- the product's inventory check strategy
-
setInventoryReservationStrategy
Describes when the product's inventory should be reserved.- Parameters:
inventoryReservationStrategy
- the product's inventory reservation strategy
-
setTags
A list of simple labels used to categorize the product- Parameters:
tags
- a list of simple labels used to categorize the product
-
setParentCategories
AllCategories
that include the product.- Parameters:
parentCategories
- AllCategories
that include the product.
-
setVariants
AllVariants
for this product.- Parameters:
variants
- AllVariants
for this product.
-
setWeight
- 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
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
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:
-
setBrand
- Parameters:
brand
- the brand of this product
-
setMerchandisingType
- Parameters:
merchandisingType
- the merchandising type of this product
-
setTargetDemographic
- Parameters:
targetDemographic
- the target demographic of this product
-
setAdditionalAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setMinimumThreshold
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
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
A list ofProductTags
sorted based on the sort position of theProductTag
for the produt with ties broken byAdvancedTag.getPriority()
.- Parameters:
advancedTags
- A list ofProductTags
.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-