Class 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:
    Serialized Form
    • Constructor Detail

      • Product

        public Product()
    • Method Detail

      • 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
      • 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.
      • 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
      • 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:
        DefaultProductType
      • 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.
      • 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
      • 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.
      • 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
      • 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:
        DefaultProductType
      • 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.
      • setAttributes

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

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object