Class Product
- All Implemented Interfaces:
Priceable,com.broadleafcommerce.money.CurrencyConsumer,Serializable,javax.money.CurrencySupplier
- 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.Similar todefault term, the default frequency is used for the initial display price for the 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.AllLiteVariantsfor this product.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.Specifies a payment strategy to use for this product.javax.money.MonetaryAmountgetPrice()The price of the product.com.broadleafcommerce.pricing.client.domain.PriceInfoSummary of thepricing informationrelated to the product.javax.money.MonetaryAmountCalculates the total with theincludedProductsandDefaultProductOptionType.ITEM_CHOICEtypeoptionsthat haveItemChoice.getMinimumQuantity()greater than 0.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.If the product has required options, this will be populated with aSearchProductRequiredOptionInfofor each, summarizing the information about them for indexing.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.The pricing strategy for this product's variants, only applicable toDefaultProductType.VARIANT_BASEDproductsAllVariantsfor 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.voidsetDefaultFrequency(ProductRecurringFrequency defaultFrequency) Similar todefault term, the default frequency is used for the initial display price for the 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.voidsetLiteVariants(List<LiteVariant> liteVariants) AllLiteVariantsfor this product.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.voidsetPaymentStrategy(String paymentStrategy) Specifies a payment strategy to use for 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.voidsetRequiredOptionInfos(List<SearchProductRequiredOptionInfo> requiredOptionInfos) If the product has required options, this will be populated with aSearchProductRequiredOptionInfofor each, summarizing the information about them for indexing.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.voidsetVariantPricingStrategy(String variantPricingStrategy) The pricing strategy for this product's variants, only applicable toDefaultProductType.VARIANT_BASEDproductsvoidsetVariants(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.
-
getPriceWithDependentItems
@Nullable public javax.money.MonetaryAmount getPriceWithDependentItems()Calculates the total with theincludedProductsandDefaultProductOptionType.ITEM_CHOICEtypeoptionsthat haveItemChoice.getMinimumQuantity()greater than 0.This will be null for any products that are not type
DefaultProductType.MERCHANDISING_PRODUCT.- Returns:
- sum of IncludedProducts' and required ItemChoices' prices.
- Since:
- Catalog Browse Service 2.0.7, Release Train 2.1.5
-
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.
-
getVariantPricingStrategy
The pricing strategy for this product's variants, only applicable toDefaultProductType.VARIANT_BASEDproducts- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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.
-
getLiteVariants
AllLiteVariantsfor this product. This is a lightweight representation ofVariantused for performance.- Returns:
- All
LiteVariantsfor this product. - Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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. -
getDefaultFrequency
Similar todefault term, the default frequency is used for the initial display price for the product.Only relevant for products with recurring pricing.
- Returns:
- the default frequency to use for the initial display price
- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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
-
getPaymentStrategy
Specifies a payment strategy to use for this product.Typically, this is determined by information from a pricing service rather than by the catalog service. However, in the case of
merchandising products, this needs to be set directly on the product since the Product's price is the sum of its add-ons. That is to say that the payment strategy to use can't be derived from an external pricing service since the merchandising product cannot be targeted directly for pricing. The merchandising product's payment strategy (and terms) will override the add-ons' defaults.Currently, this is only used for
merchandising products.- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
- See Also:
-
DefaultPaymentStrategy
-
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
-
getRequiredOptionInfos
If the product has required options, this will be populated with aSearchProductRequiredOptionInfofor each, summarizing the information about them for indexing. By default, this only applies tomerchandising productssince their prices are determined by the choices so additional information may be necessary for correct pricing.- 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
-
setVariantPricingStrategy
The pricing strategy for this product's variants, only applicable toDefaultProductType.VARIANT_BASEDproducts- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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.
-
setLiteVariants
AllLiteVariantsfor this product. This is a lightweight representation ofVariantused for performance.- Parameters:
liteVariants- AllVariantsfor this product.- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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. -
setDefaultFrequency
Similar todefault term, the default frequency is used for the initial display price for the product.Only relevant for products with recurring pricing.
- Parameters:
defaultFrequency- the default frequency to use for the initial display price- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
-
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
-
setPaymentStrategy
Specifies a payment strategy to use for this product.Typically, this is determined by information from a pricing service rather than by the catalog service. However, in the case of
merchandising products, this needs to be set directly on the product since the Product's price is the sum of its add-ons. That is to say that the payment strategy to use can't be derived from an external pricing service since the merchandising product cannot be targeted directly for pricing. The merchandising product's payment strategy (and terms) will override the add-ons' defaults.Currently, this is only used for
merchandising products.- Since:
- Catalog Browse Service 2.2.0, Release Train 2.3.0
- See Also:
-
DefaultPaymentStrategy
-
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
-
setRequiredOptionInfos
If the product has required options, this will be populated with aSearchProductRequiredOptionInfofor each, summarizing the information about them for indexing. By default, this only applies tomerchandising productssince their prices are determined by the choices so additional information may be necessary for correct pricing.- 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
-