java.lang.Object
com.broadleafcommerce.subscriptionoperation.domain.Product
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.money.CurrencyConsumer, SubscriptionReferencedItem, Serializable, javax.money.CurrencySupplier

public class Product extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware, javax.money.CurrencySupplier, com.broadleafcommerce.money.CurrencyConsumer, SubscriptionReferencedItem
The product containing the details related to subscriptions.
Author:
Sunny Yu
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.
    • getUpgradeOptionReferences

      @NonNull public List<String> getUpgradeOptionReferences()
      Description copied from interface: SubscriptionReferencedItem
      List of references (usually IDs) to items that this can upgrade to.
      Specified by:
      getUpgradeOptionReferences in interface SubscriptionReferencedItem
      Returns:
      List of references (usually IDs) to items that this can upgrade to.
    • getDowngradeOptionReferences

      @NonNull public List<String> getDowngradeOptionReferences()
      Description copied from interface: SubscriptionReferencedItem
      List of references (usually IDs) to items that this can downgrade to.
      Specified by:
      getDowngradeOptionReferences in interface SubscriptionReferencedItem
      Returns:
      List of references (usually IDs) to items that this can downgrade to.
    • getId

      public String getId()
      The id of the product.
      Specified by:
      getId in interface SubscriptionReferencedItem
      Returns:
      The ID used by the system to identify this item
    • getName

      public String getName()
      Name of this product.
    • getCurrency

      public javax.money.CurrencyUnit getCurrency()
      Currency for all of the prices on this product
      Specified by:
      getCurrency in interface javax.money.CurrencySupplier
    • getMinimumThreshold

      public Integer getMinimumThreshold()
      The minimum count of this product that must be added in a cart.
      Specified by:
      getMinimumThreshold in interface SubscriptionReferencedItem
      Returns:
      the minimum count of this item that must be added in a cart
    • getMaximumThreshold

      public Integer getMaximumThreshold()
      The maximum count of this product that must be added in a cart.
      Specified by:
      getMaximumThreshold in interface SubscriptionReferencedItem
      Returns:
      the maximum count of this item 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.
    • getUpgradeProductIds

      public List<String> getUpgradeProductIds()
      The list of ids of the product that this product can upgrade to.
    • getDowngradeProductIds

      public List<String> getDowngradeProductIds()
      The list of ids of the product that this product can downgrade to.
    • getRestrictDowngradeAfterDays

      public Integer getRestrictDowngradeAfterDays()
      The number of days after which a downgrade is not allowed, until the window re-opens at the next billing cycle. null means no restriction.
      Specified by:
      getRestrictDowngradeAfterDays in interface SubscriptionReferencedItem
      Returns:
      The number of days after which a downgrade is not allowed.
    • getMaxNumberOfActiveSubscriptions

      public Integer getMaxNumberOfActiveSubscriptions()
      The max number of active subscriptions that can be created for this product. null means no restriction.
      Specified by:
      getMaxNumberOfActiveSubscriptions in interface SubscriptionReferencedItem
      Returns:
      The max number of active subscriptions that can be created for this item.
    • isAllowQtyEditAfterInitialPurchase

      public boolean isAllowQtyEditAfterInitialPurchase()
      Whether quantity can be edited after initial purchase.
    • isAllowChangingBillingFrequency

      public boolean isAllowChangingBillingFrequency()
      Whether the billing frequency can be changed after initial purchase.
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • 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 id of the product.
    • setName

      public void setName(String name)
      Name of this product.
    • setCurrency

      public void setCurrency(javax.money.CurrencyUnit currency)
      Currency for all of the prices on this product
      Specified by:
      setCurrency in interface com.broadleafcommerce.money.CurrencyConsumer
    • setMinimumThreshold

      public void setMinimumThreshold(Integer 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.
    • 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
    • setUpgradeProductIds

      public void setUpgradeProductIds(List<String> upgradeProductIds)
      The list of ids of the product that this product can upgrade to.
    • setDowngradeProductIds

      public void setDowngradeProductIds(List<String> downgradeProductIds)
      The list of ids of the product that this product can downgrade to.
    • setRestrictDowngradeAfterDays

      public void setRestrictDowngradeAfterDays(Integer restrictDowngradeAfterDays)
      The number of days after which a downgrade is not allowed, until the window re-opens at the next billing cycle. null means no restriction.
    • setMaxNumberOfActiveSubscriptions

      public void setMaxNumberOfActiveSubscriptions(Integer maxNumberOfActiveSubscriptions)
      The max number of active subscriptions that can be created for this product. null means no restriction.
    • setAllowQtyEditAfterInitialPurchase

      public void setAllowQtyEditAfterInitialPurchase(boolean allowQtyEditAfterInitialPurchase)
      Whether quantity can be edited after initial purchase.
    • setAllowChangingBillingFrequency

      public void setAllowChangingBillingFrequency(boolean allowChangingBillingFrequency)
      Whether the billing frequency can be changed after initial purchase.
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • 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