Class Product
java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.Product
- All Implemented Interfaces:
Priceable,com.broadleafcommerce.money.CurrencyConsumer,Serializable,javax.money.CurrencySupplier
public class Product
extends Object
implements Serializable, com.broadleafcommerce.money.CurrencyConsumer, javax.money.CurrencySupplier, Priceable
A structure containing all the info necessary for a product details page shown in a
commerce-facing app (as opposed to a PIM UI).
- 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 booleanbooleanA list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().AllAssetassets for this product.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 summary of inventory availability for this product's SKU.List of all hierarchical parent category ids for the product.Fields and associated Characteristics that define a specific product.javax.money.CurrencyUnitCurrency for this product.getId()The unique identifier for this product.Additional products or variants that are always included with the product, no matter what.Indicates whether inventory should be checked, and how.Indicates whether Inventory should be reserved, and how.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.Drives additional information that the customer should enter when purchasing this product.javax.money.MonetaryAmountgetPrice()The price of 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.The primary or defaultAssetto display.Defines the type of the product.Map of all of the relatedPromotionalProductsgrouped bytype.getSku()This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.getTerms()The list ofProductTermsthat are associated with this product.AllVariantsfor this product.Soft reference to the vendor associated with this catalog.inthashCode()voidsetAdvancedTags(List<ProductTag> advancedTags) A list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().voidAllAssetassets for this product.voidsetAttributes(Map<String, Object> attributes) Map holding any additional attributes passed in the request not matching any defined properties.voidsetAvailabilitySummary(SkuInventoryAvailabilitySummary availabilitySummary) A summary of inventory availability for this product's SKU.voidsetCategoryIdsWithParents(List<String> categoryIdsWithParents) List of all hierarchical parent category ids for the product.voidsetCharacteristics(Map<String, ProductCharacteristic> characteristics) Fields and associated Characteristics that define a specific product.voidsetCurrency(javax.money.CurrencyUnit currency) Currency for this product.voidThe unique identifier for this product.voidsetIncludedProducts(List<IncludedProduct> includedProducts) Additional products or variants that are always included with the product, no matter what.voidsetInventoryCheckStrategy(String inventoryCheckStrategy) Indicates whether inventory should be checked, and how.voidsetInventoryReservationStrategy(String inventoryReservationStrategy) Indicates whether Inventory should be reserved, and how.voidsetMaximumThreshold(Integer maximumThreshold) The maximum count of this product that must be added in a cart.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.voidsetOptions(List<ProductOption> options) Drives additional information that the customer should enter when purchasing this product.voidsetPrice(javax.money.MonetaryAmount price) The price of 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(Asset primaryAsset) The primary or defaultAssetto display.voidsetProductType(String productType) Defines the type of the product.voidsetPromotionalProducts(Map<String, List<PromotionalProduct>> promotionalProducts) Map of all of the relatedPromotionalProductsgrouped bytype.voidThis uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.voidsetTerms(List<ProductTerm> terms) The list ofProductTermsthat are associated with this product.voidsetVariants(List<Variant> variants) AllVariantsfor this product.voidsetVendorRef(String vendorRef) Soft reference to the vendor associated with this catalog.toString()
-
Constructor Details
-
Product
public Product()
-
-
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.
-
getId
The unique identifier for this product.- Returns:
- The unique identifier for 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.- Returns:
- the Stock Keeping Unit identifier which means that this Product is sold in the store
-
getPriceInfo
public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()Summary of thepricing informationrelated to the product.- Specified by:
getPriceInfoin interfacePriceable- Returns:
- The
PriceInfoon the entity.
-
getCurrency
public javax.money.CurrencyUnit getCurrency()Currency for this product.- Specified by:
getCurrencyin interfacejavax.money.CurrencySupplier- Returns:
- currency
-
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
-
getPrice
public javax.money.MonetaryAmount getPrice()The price of the product. Sometimes services won't return a propertyPriceInfobut just a price instead. This should be converted to a price info and not returned as a separate field.- Returns:
- The price of the 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.- Returns:
- the merging type to use for this Product
-
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
-
getInventoryCheckStrategy
Indicates whether inventory should be checked, and how. Typical values are: NEVER, ADD_TO_CART If this value is anything except null or 'NEVER' then generally inventory should be checked. Note that inventory reservation does an inventory check too, so these properties are similar, especially from a browse perspective.- Returns:
- the inventory check strategy, or null.
-
getInventoryReservationStrategy
Indicates whether Inventory should be reserved, and how. Typical values are: NEVER, ADD_TO_CART, SUBMIT_ORDER If this value is anything except null or 'NEVER' then generally inventory should be reserved or decremented.- Returns:
- the inventory reservation strategy, or null.
-
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.
-
getVariants
AllVariantsfor this product.- Returns:
- All
Variantsfor this product.
-
getCategoryIdsWithParents
List of all hierarchical parent category ids for the product.For example, if we have a category setup of: Top -> Level2 -> Level3 and the product is assigned to Level3, the list would be
{Top, Level2, Level3}.- Returns:
- List of all hierarchical parent category ids for the product.
-
getIncludedProducts
Additional products or variants that are always included with the product, no matter what. Used to create fixed "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 or variants that are always included with the product
-
getPromotionalProducts
Map of all of the relatedPromotionalProductsgrouped bytype.- Returns:
- Related
PromotionalProductsgrouped bytype.
-
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.- Returns:
- The type of the product
- See Also:
-
getAssets
AllAssetassets for this product.- Returns:
- All
Assetassets for this product.
-
getPrimaryAsset
The primary or defaultAssetto display.- Returns:
- The primary or default
Assetto display.
-
getAdvancedTags
A list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().- Returns:
- A list of
ProductTags.
-
getAvailabilitySummary
A summary of inventory availability for this product's SKU. -
getTerms
The list ofProductTermsthat are associated with this product.- Returns:
- the list of terms associated with this product
- Since:
- Catalog Browse Service 2.1.0, Release Train 2.2.0
-
getCharacteristics
Fields and associated Characteristics that define a specific product. These are typically manifested upon creation of a Product via a Business Type- Returns:
- fields and associated characteristics that define this Product
- Since:
- Catalog Browse Service 2.1.0, Release Train 2.2.0
-
getAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
setId
The unique identifier for this product.- Parameters:
id- The unique identifier for 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
-
setPriceInfo
public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo) Summary of thepricing informationrelated to the product.- Specified by:
setPriceInfoin interfacePriceable- Parameters:
priceInfo- ThePriceInfoto set.
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) Currency for this product.- Specified by:
setCurrencyin interfacecom.broadleafcommerce.money.CurrencyConsumer- Parameters:
currency-
-
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)
-
setPrice
public void setPrice(javax.money.MonetaryAmount price) The price of the product. Sometimes services won't return a propertyPriceInfobut just a price instead. This should be converted to a price info and not returned as a separate field.- Parameters:
price- The price of the product.
-
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
-
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
-
setInventoryCheckStrategy
Indicates whether inventory should be checked, and how. Typical values are: NEVER, ADD_TO_CART If this value is anything except null or 'NEVER' then generally inventory should be checked. Note that inventory reservation does an inventory check too, so these properties are similar, especially from a browse perspective.- Parameters:
inventoryCheckStrategy- The inventoryCheckStrategy if/when inventory should be checked, usually during browsing
-
setInventoryReservationStrategy
Indicates whether Inventory should be reserved, and how. Typical values are: NEVER, ADD_TO_CART, SUBMIT_ORDER If this value is anything except null or 'NEVER' then generally inventory should be reserved or decremented.- Parameters:
inventoryReservationStrategy- the strategy for reserving inventory
-
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
-
setVariants
AllVariantsfor this product.- Parameters:
variants- AllVariantsfor this product.
-
setCategoryIdsWithParents
List of all hierarchical parent category ids for the product.For example, if we have a category setup of: Top -> Level2 -> Level3 and the product is assigned to Level3, the list would be
{Top, Level2, Level3}.- Parameters:
parentCategoryIds- List of all hierarchical parent category ids for the product.
-
setIncludedProducts
Additional products or variants that are always included with the product, no matter what. Used to create fixed "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- Additional products or variants that are always included with the product
-
setPromotionalProducts
Map of all of the relatedPromotionalProductsgrouped bytype.- Parameters:
promotionalProducts- RelatedPromotionalProductsgrouped bytype.
-
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.- Parameters:
productType- The type of the product- See Also:
-
setAssets
AllAssetassets for this product.- Parameters:
assets- AllAssetassets for this product.
-
setPrimaryAsset
The primary or defaultAssetto display.- Parameters:
primaryAsset- The primary or defaultAssetto display.
-
setAdvancedTags
A list ofProductTagssorted based on the sort position of theProductTagfor the produt with ties broken byAdvancedTag.getPriority().- Parameters:
advancedTags- A list ofProductTags.
-
setAvailabilitySummary
A summary of inventory availability for this product's SKU. -
setTerms
The list ofProductTermsthat are associated with this product.- Parameters:
terms- the list of terms associated with this product- Since:
- Catalog Browse Service 2.1.0, Release Train 2.2.0
-
setCharacteristics
Fields and associated Characteristics that define a specific product. These are typically manifested upon creation of a Product via a Business Type- Parameters:
characteristics- fields and associated characteristics that define this Product- Since:
- Catalog Browse Service 2.1.0, Release Train 2.2.0
-
setAttributes
Map holding any additional attributes passed in the request not matching any defined properties. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-