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 Details

    • Product

      public Product()
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttribute

      public Map<String,Object> 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

      public String getId()
      The unique identifier for this product.
      Returns:
      The unique identifier for 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
    • getPriceInfo

      public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()
      Summary of the pricing information related to the product.
      Specified by:
      getPriceInfo in interface Priceable
      Returns:
      The PriceInfo on the entity.
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      Currency for this product.
      Specified by:
      getCurrency in interface javax.money.CurrencySupplier
      Returns:
      currency
    • 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
    • getPrice

      public javax.money.MonetaryAmount getPrice()
      The price of the product. Sometimes services won't return a property PriceInfo but 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

      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 in DefaultMergingType.
      Returns:
      the merging type to use for this Product
    • 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
    • getInventoryCheckStrategy

      public String 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

      public String 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

      public List<ProductOption> getOptions()
      Drives additional information that the customer should enter when purchasing this product. this can be in the form of additional variations, 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

      public List<Variant> getVariants()
      All Variants for this product.
      Returns:
      All Variants for this product.
    • getCategoryIdsWithParents

      public List<String> 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

      public List<IncludedProduct> 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 options instead.

      Returns:
      Additional products or variants that are always included with the product
    • getPromotionalProducts

      public Map<String,List<PromotionalProduct>> getPromotionalProducts()
      Map of all of the related PromotionalProducts grouped by type.
      Returns:
      Related PromotionalProducts grouped by type.
    • 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.
      Returns:
      The type of the product
      See Also:
    • getAssets

      public List<Asset> getAssets()
      All Asset assets for this product.
      Returns:
      All Asset assets for this product.
    • getPrimaryAsset

      public Asset getPrimaryAsset()
      The primary or default Asset to display.
      Returns:
      The primary or default Asset to display.
    • getAdvancedTags

      public List<ProductTag> getAdvancedTags()
      A list of ProductTags sorted based on the sort position of the ProductTag for the produt with ties broken by AdvancedTag.getPriority().
      Returns:
      A list of ProductTags.
    • getAvailabilitySummary

      @Nullable public SkuInventoryAvailabilitySummary getAvailabilitySummary()
      A summary of inventory availability for this product's SKU.
    • getTerms

      public List<ProductTerm> getTerms()
      The list of ProductTerms that 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

      public Map<String,ProductCharacteristic> 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

      public Map<String,Object> getAttributes()
      Map holding any additional attributes passed in the request not matching any defined properties.
    • setId

      public void setId(String id)
      The unique identifier for this product.
      Parameters:
      id - The unique identifier for 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 related variant's sku to declare a default variant/default sku for the product
    • setPriceInfo

      public void setPriceInfo(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
      Summary of the pricing information related to the product.
      Specified by:
      setPriceInfo in interface Priceable
      Parameters:
      priceInfo - The PriceInfo to set.
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      Currency for this product.
      Specified by:
      setCurrency in interface com.broadleafcommerce.money.CurrencyConsumer
      Parameters:
      currency -
    • 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)
    • setPrice

      public void setPrice(javax.money.MonetaryAmount price)
      The price of the product. Sometimes services won't return a property PriceInfo but 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

      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 in DefaultMergingType.
      Parameters:
      mergingType - the merging type to use for this Product
    • 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
    • setInventoryCheckStrategy

      public void setInventoryCheckStrategy(String inventoryCheckStrategy)
      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

      public void setInventoryReservationStrategy(String inventoryReservationStrategy)
      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

      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 additional variations, 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

      public void setVariants(List<Variant> variants)
      All Variants for this product.
      Parameters:
      variants - All Variants for this product.
    • setCategoryIdsWithParents

      public void setCategoryIdsWithParents(List<String> categoryIdsWithParents)
      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

      public void setIncludedProducts(List<IncludedProduct> includedProducts)
      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 options instead.

      Parameters:
      includedProducts - Additional products or variants that are always included with the product
    • setPromotionalProducts

      public void setPromotionalProducts(Map<String,List<PromotionalProduct>> promotionalProducts)
      Map of all of the related PromotionalProducts grouped by type.
      Parameters:
      promotionalProducts - Related PromotionalProducts grouped by type.
    • 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.
      Parameters:
      productType - The type of the product
      See Also:
    • setAssets

      public void setAssets(List<Asset> assets)
      All Asset assets for this product.
      Parameters:
      assets - All Asset assets for this product.
    • setPrimaryAsset

      public void setPrimaryAsset(Asset primaryAsset)
      The primary or default Asset to display.
      Parameters:
      primaryAsset - The primary or default Asset to display.
    • setAdvancedTags

      public void setAdvancedTags(List<ProductTag> advancedTags)
      A list of ProductTags sorted based on the sort position of the ProductTag for the produt with ties broken by AdvancedTag.getPriority().
      Parameters:
      advancedTags - A list of ProductTags.
    • setAvailabilitySummary

      public void setAvailabilitySummary(@Nullable SkuInventoryAvailabilitySummary availabilitySummary)
      A summary of inventory availability for this product's SKU.
    • setTerms

      public void setTerms(List<ProductTerm> terms)
      The list of ProductTerms that 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

      public void setCharacteristics(Map<String,ProductCharacteristic> characteristics)
      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

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object