Class Product
- All Implemented Interfaces:
CatalogItem,com.broadleafcommerce.money.jackson.CurrencyContextAware
- Author:
- Chad Harchar (charchar)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionalAttribute(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.A list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().List<com.broadleafcommerce.cart.client.domain.ImageAssetRef>AllProductAssetsfor this product.Dynamic attributes that are a part of the product.getBrand()javax.money.CurrencyUnitcom.broadleafcommerce.money.CurrencyContextTransient 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.AllCategoriesthat include the product.com.broadleafcommerce.pricing.client.domain.PriceInfoSummary of thepricing informationrelated to the product.System-wide unique identifier to configure specific pricing for the product.com.broadleafcommerce.cart.client.domain.ImageAssetRefThe 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.AllVariantsfor this product.Soft reference to the vendor associated with this catalog.inthashCode()booleanWhether or not this product is available online - ie inventory is available somewhere to fulfill this product.booleanWhether or not this product be applied to any offers or promotions.booleanIf 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.voidsetAdditionalAttributes(Map<String, Object> additionalAttributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetAdvancedTags(List<ProductTag> advancedTags) A list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().voidAllProductAssetsfor this product.voidsetAttributes(Map<String, Attribute> attributes) Dynamic attributes that are a part of the product.voidsetAvailableOnline(boolean availableOnline) Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.voidsetBrand(DataDrivenEnum brand) voidsetCurrencyContext(com.broadleafcommerce.money.CurrencyContext currencyContext) Transient ability to have a currency initializedvoidsetDiscountable(boolean discountable) Whether or not this product be applied to any offers or promotions.voidsetFulfillmentFlatRates(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).voidThe ID of the Product.voidsetIncludedProducts(List<IncludedProduct> includedProducts) Additional products that are always included with the product, no matter what.voidsetIndividuallySold(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.voidsetInventoryCheckStrategy(String inventoryCheckStrategy) Describes when the product's inventory should be checked for availability.voidsetInventoryReservationStrategy(String inventoryReservationStrategy) Describes when the product's inventory should be reserved.voidsetInventoryType(String inventoryType) Describes the product's type of fulfillment - ie is it a physical or virtual item?voidsetMaximumThreshold(Integer maximumThreshold) The maximum count of this product that must be added in a cart.voidsetMerchandisingType(DataDrivenEnum merchandisingType) voidsetMergingType(String mergingType) Determines how this Product should merge with other similar items when it gets added to a cart.voidsetMinimumThreshold(Integer minimumThreshold) The minimum count of this product that must be added in a cart.voidThe name of the product.voidsetOptions(List<ProductOption> options) Drives additional information that the customer should enter when purchasing this product.voidsetParentCategories(Set<Category> parentCategories) AllCategoriesthat include the product.voidsetPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the product.voidsetPricingKey(String pricingKey) System-wide unique identifier to configure specific pricing for the product.voidsetPrimaryAsset(com.broadleafcommerce.cart.client.domain.ImageAssetRef primaryAsset) The asset associated with this product marked as primary.voidsetProductType(String productType) Defines the type of the product.voidThis uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.voidA list of simple labels used to categorize the productvoidsetTargetDemographic(DataDrivenEnum targetDemographic) voidThe navigable uri of this product.voidsetVariants(List<Variant> variants) AllVariantsfor this product.voidsetVendorRef(String vendorRef) Soft reference to the vendor associated with this catalog.voidtoString()
-
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:
getIdin 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:
getSkuin 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 informationrelated to the product.- Specified by:
getPriceInfoin interfaceCatalogItem- Returns:
- Summary of the
pricing informationrelated 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:
getPricingKeyin 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:
getMergingTypein 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_STANDARDorBANDED_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
optionsinstead.- 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
AllProductAssetsfor this product.- Returns:
- All
ProductAssetsfor 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
AllCategoriesthat include the product.- Returns:
- All
Categoriesthat include the product.
-
getVariants
AllVariantsfor this product.- Returns:
- All
Variantsfor 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:
getCurrencyContextin 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 theinternalAttributesunder theCartItemAttributeConstants.Internal.PRODUCT_TYPEkey 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 ofProductTagssorted based on the sort position of theProductTagfor 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'ssku 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 informationrelated to the product.- Parameters:
priceInfo- Summary of thepricing informationrelated 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_STANDARDorBANDED_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
optionsinstead.- 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
AllProductAssetsfor this product.- Parameters:
assets- AllProductAssetsfor 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
AllCategoriesthat include the product.- Parameters:
parentCategories- AllCategoriesthat include the product.
-
setVariants
AllVariantsfor this product.- Parameters:
variants- AllVariantsfor 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:
setCurrencyContextin 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 theinternalAttributesunder theCartItemAttributeConstants.Internal.PRODUCT_TYPEkey 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 ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().- Parameters:
advancedTags- A list ofProductTags.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-