Class SubscriptionItem

java.lang.Object
com.broadleafcommerce.subscriptionoperation.domain.SubscriptionItem
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class SubscriptionItem extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
This represents a line item for a Subscription
See Also:
  • Constructor Details

    • SubscriptionItem

      public SubscriptionItem()
    • SubscriptionItem

      public SubscriptionItem(String id, String subscriptionId, String itemName, String itemRefType, String itemRef, String itemSku, Map<String,String> itemDetails, String parentItemRefType, String parentItemRef, String itemSourceType, String itemSourceRef, String secondarySourceType, String secondarySourceRef, String addOnKey, BigDecimal itemUnitPrice, int quantity, boolean taxable, String taxCategory, String taxNexus, boolean archived, String archiveReason, List<SubscriptionItemAdjustment> subscriptionItemAdjustments, String priceDataId, String priceListId, Map<String,Object> internalAttributes, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      Creates a new SubscriptionItem instance.
      Parameters:
      id -
      subscriptionId - Reference the subscription for this item
      itemName - Item name
      itemRefType - Type of item that this object represents. For example, BLC_PRODUCT.
      itemRef - Reference to the id of the item represented by this object. For example, the product id.
      itemSku - SKU of the item represented by this object.
      itemDetails - Additional details about the item
      parentItemRefType - Type of the parent subscription item's backing item if this is a child subscription item
      parentItemRef - Reference of the parent subscription item's backing item if this is a child subscription item
      itemSourceType - This field shows from which process or user action this subscription item originated.
      itemSourceRef - This field shows the identifier of the process or user action this subscription item originated.
      secondarySourceType - The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      secondarySourceRef - The secondary source to reference, e.g, an Order Item on an Order. Optional.
      addOnKey - If this item was the result of an add-on, then this stores the key of the add-on in the context of its parent. This is important when editing a subscription in order to recreate the original cart item.
      itemUnitPrice - Unit price of the item (price of a single unit)
      quantity - Quantity purchased. Note: this value is scaled by parent item quantity.
      taxable - Whether this item is taxable
      taxCategory - Tax category of the item
      taxNexus - Comma-separated nexus codes
      archived - Whether this item is archived
      archiveReason - Why this item was archived
      subscriptionItemAdjustments - Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
      priceDataId - The id of the price data associated with this item.
      priceListId - The id of the price list associated with this item.
      internalAttributes - Miscellaneous internal attributes for this subscription item.
      contextState - A subset of Tracking information to expose the context state for this object.
      See Also:
  • Method Details

    • getId

      public String getId()
    • getSubscriptionId

      public String getSubscriptionId()
      Reference the subscription for this item
    • getItemName

      public String getItemName()
      Item name
    • getItemRefType

      public String getItemRefType()
      Type of item that this object represents. For example, BLC_PRODUCT.
    • getItemRef

      public String getItemRef()
      Reference to the id of the item represented by this object. For example, the product id.
    • getItemSku

      public String getItemSku()
      SKU of the item represented by this object.
    • getItemDetails

      public Map<String,String> getItemDetails()
      Additional details about the item
    • getParentItemRefType

      public String getParentItemRefType()
      Type of the parent subscription item's backing item if this is a child subscription item
    • getParentItemRef

      public String getParentItemRef()
      Reference of the parent subscription item's backing item if this is a child subscription item
    • getItemSourceType

      public String getItemSourceType()
      This field shows from which process or user action this subscription item originated.
      See Also:
    • getItemSourceRef

      public String getItemSourceRef()
      This field shows the identifier of the process or user action this subscription item originated.
      See Also:
      • itemSourceType
    • getSecondarySourceType

      public String getSecondarySourceType()
      The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
    • getSecondarySourceRef

      public String getSecondarySourceRef()
      The secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
      • secondarySourceType
    • getAddOnKey

      public String getAddOnKey()
      If this item was the result of an add-on, then this stores the key of the add-on in the context of its parent. This is important when editing a subscription in order to recreate the original cart item.
    • getItemUnitPrice

      public BigDecimal getItemUnitPrice()
      Unit price of the item (price of a single unit)
    • getQuantity

      public int getQuantity()
      Quantity purchased. Note: this value is scaled by parent item quantity.
    • isTaxable

      public boolean isTaxable()
      Whether this item is taxable
    • getTaxCategory

      public String getTaxCategory()
      Tax category of the item
    • getTaxNexus

      public String getTaxNexus()
      Comma-separated nexus codes
    • isArchived

      public boolean isArchived()
      Whether this item is archived
    • getArchiveReason

      public String getArchiveReason()
      Why this item was archived
    • getSubscriptionItemAdjustments

      public List<SubscriptionItemAdjustment> getSubscriptionItemAdjustments()
      Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
    • getPriceDataId

      public String getPriceDataId()
      The id of the price data associated with this item.
    • getPriceListId

      public String getPriceListId()
      The id of the price list associated with this item.
    • getInternalAttributes

      public Map<String,Object> getInternalAttributes()
      Miscellaneous internal attributes for this subscription item.
    • 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
    • setId

      public void setId(String id)
    • setSubscriptionId

      public void setSubscriptionId(String subscriptionId)
      Reference the subscription for this item
    • setItemName

      public void setItemName(String itemName)
      Item name
    • setItemRefType

      public void setItemRefType(String itemRefType)
      Type of item that this object represents. For example, BLC_PRODUCT.
    • setItemRef

      public void setItemRef(String itemRef)
      Reference to the id of the item represented by this object. For example, the product id.
    • setItemSku

      public void setItemSku(String itemSku)
      SKU of the item represented by this object.
    • setItemDetails

      public void setItemDetails(Map<String,String> itemDetails)
      Additional details about the item
    • setParentItemRefType

      public void setParentItemRefType(String parentItemRefType)
      Type of the parent subscription item's backing item if this is a child subscription item
    • setParentItemRef

      public void setParentItemRef(String parentItemRef)
      Reference of the parent subscription item's backing item if this is a child subscription item
    • setItemSourceType

      public void setItemSourceType(String itemSourceType)
      This field shows from which process or user action this subscription item originated.
      See Also:
    • setItemSourceRef

      public void setItemSourceRef(String itemSourceRef)
      This field shows the identifier of the process or user action this subscription item originated.
      See Also:
      • itemSourceType
    • setSecondarySourceType

      public void setSecondarySourceType(String secondarySourceType)
      The type of the secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
    • setSecondarySourceRef

      public void setSecondarySourceRef(String secondarySourceRef)
      The secondary source to reference, e.g, an Order Item on an Order. Optional.
      See Also:
      • secondarySourceType
    • setAddOnKey

      public void setAddOnKey(String addOnKey)
      If this item was the result of an add-on, then this stores the key of the add-on in the context of its parent. This is important when editing a subscription in order to recreate the original cart item.
    • setItemUnitPrice

      public void setItemUnitPrice(BigDecimal itemUnitPrice)
      Unit price of the item (price of a single unit)
    • setQuantity

      public void setQuantity(int quantity)
      Quantity purchased. Note: this value is scaled by parent item quantity.
    • setTaxable

      public void setTaxable(boolean taxable)
      Whether this item is taxable
    • setTaxCategory

      public void setTaxCategory(String taxCategory)
      Tax category of the item
    • setTaxNexus

      public void setTaxNexus(String taxNexus)
      Comma-separated nexus codes
    • setArchived

      public void setArchived(boolean archived)
      Whether this item is archived
    • setArchiveReason

      public void setArchiveReason(String archiveReason)
      Why this item was archived
    • setSubscriptionItemAdjustments

      public void setSubscriptionItemAdjustments(List<SubscriptionItemAdjustment> subscriptionItemAdjustments)
      Adjustments for this subscription. This field is used for creation from an API request and is not persisted with the object
    • setPriceDataId

      public void setPriceDataId(String priceDataId)
      The id of the price data associated with this item.
    • setPriceListId

      public void setPriceListId(String priceListId)
      The id of the price list associated with this item.
    • setInternalAttributes

      public void setInternalAttributes(Map<String,Object> internalAttributes)
      Miscellaneous internal attributes for this subscription item.
    • 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
    • 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