java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.LineItemDto
All Implemented Interfaces:
LineItem, Serializable
Direct Known Subclasses:
FulfillmentLineItemDto, OrderLineItemDto

public class LineItemDto extends Object implements LineItem, Serializable
See Also:
  • Constructor Details

    • LineItemDto

      public LineItemDto()
  • Method Details

    • isSubscription

      public boolean isSubscription()
      Description copied from interface: LineItem
      Whether this is a subscription item and thus qualifies it for future billing discounts.
      Specified by:
      isSubscription in interface LineItem
      Returns:
      Whether this is a subscription item and thus qualifies it for future billing discounts.
    • hasRecurringPrice

      protected boolean hasRecurringPrice()
      Helper method to determine if there is any kind of recurring price.
      Returns:
      Whether there is any kind of recurring price.
      Since:
      Offer Client 2.0.2
    • getLineNumber

      public String getLineNumber()
      Identifier for this line item.
      Specified by:
      getLineNumber in interface LineItem
      Returns:
      The line number of this order item.
    • getStandardPrice

      public javax.money.MonetaryAmount getStandardPrice()
      The one-time price typically discounted.
      Specified by:
      getStandardPrice in interface LineItem
      Returns:
      The standard price at which this item is sold or fulfilled.
    • getSalePrice

      public javax.money.MonetaryAmount getSalePrice()
      Sale price. Often not discountable.
      Specified by:
      getSalePrice in interface LineItem
      Returns:
      Special price at which to sell or fulfill this item.
    • getQuantity

      public int getQuantity()
      The quantity of the item in the order.
      Specified by:
      getQuantity in interface LineItem
      Returns:
      Number of like merchandising items being sold or fulfilled together in this order.
    • isDiscountable

      public boolean isDiscountable()
      Whether the item is discountable.
      Specified by:
      isDiscountable in interface LineItem
      Returns:
      Whether this item may receive discounts
    • getStandardRecurringPrice

      public RecurringPriceDetail getStandardRecurringPrice()
      Description copied from interface: LineItem
      Represents the details related to a recurring (or subscription) price include the terms. This should come from the same source as LineItem.getStandardPrice(), and, consequently, LineItem.getStandardPrice() should not be null even if there is no upfront price, e.g., it should be zero in that case. This method is supported with ReleaseTrain 2.2.0 and beyond with a default implementation that returns null for backward compatibility.
      Specified by:
      getStandardRecurringPrice in interface LineItem
      Returns:
      The details related to a recurring (or subscription) price include the terms.
      Since:
      Offer Client 2.0.2
      See Also:
    • getSaleRecurringPrice

      public RecurringPriceDetail getSaleRecurringPrice()
      Description copied from interface: LineItem
      Represents the details related to a sale recurring (or subscription) price include the terms. This should come from the same source as LineItem.getSalePrice(), and, consequently, LineItem.getSalePrice() should not be null even if there is no upfront price, e.g., it should be zero in that case. This method is supported with ReleaseTrain 2.2.0 and beyond with a default implementation that returns null for backward compatibility.
      Specified by:
      getSaleRecurringPrice in interface LineItem
      Returns:
      The details related to a recurring (or subscription) price include the terms.
      Since:
      Offer Client 2.0.2
      See Also:
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional assortment of attributes that can be used for targeting by Offers.
      Specified by:
      getAttributes in interface LineItem
      Returns:
      Additional, unspecified attributes
    • setLineNumber

      public void setLineNumber(String lineNumber)
      Identifier for this line item.
      Specified by:
      setLineNumber in interface LineItem
      Parameters:
      lineNumber - The line number of this order item.
    • setStandardPrice

      public void setStandardPrice(javax.money.MonetaryAmount standardPrice)
      The one-time price typically discounted.
      Specified by:
      setStandardPrice in interface LineItem
      Parameters:
      standardPrice - The standard price at which this item is sold or fulfilled.
    • setSalePrice

      public void setSalePrice(javax.money.MonetaryAmount salePrice)
      Sale price. Often not discountable.
      Specified by:
      setSalePrice in interface LineItem
      Parameters:
      salePrice - Special price at which to sell or fulfill this item.
    • setQuantity

      public void setQuantity(int quantity)
      The quantity of the item in the order.
      Specified by:
      setQuantity in interface LineItem
      Parameters:
      quantity - Number of like merchandising items being sold or fulfilled together in this order.
    • setDiscountable

      public void setDiscountable(boolean discountable)
      Whether the item is discountable.
      Specified by:
      setDiscountable in interface LineItem
      Parameters:
      discountable - Whether this item may receive discounts.
    • setSubscription

      public void setSubscription(boolean isSubscription)
      Whether the item represents a subscription. This should be true if standardRecurringPrice or saleRecurringPrice are not null.
      Specified by:
      setSubscription in interface LineItem
      Parameters:
      isSubscription - Whether this is a subscription item and thus qualifies it for future billing discounts.
    • setStandardRecurringPrice

      public void setStandardRecurringPrice(RecurringPriceDetail standardRecurringPrice)
      Description copied from interface: LineItem
      Set the details related to a recurring (or subscription) price include the terms. This method is supported with ReleaseTrain 2.2.0 and beyond with an empty default implementation for backward compatibility.
      Specified by:
      setStandardRecurringPrice in interface LineItem
      Parameters:
      standardRecurringPrice - The details related to a recurring (or subscription) price include the terms.
      Since:
      Offer Client 2.0.2
      See Also:
    • setSaleRecurringPrice

      public void setSaleRecurringPrice(RecurringPriceDetail saleRecurringPrice)
      Description copied from interface: LineItem
      Set the details related to a sale recurring (or subscription) price include the terms. This method is supported with ReleaseTrain 2.2.0 and beyond with an empty default implementation for backward compatibility.
      Specified by:
      setSaleRecurringPrice in interface LineItem
      Parameters:
      saleRecurringPrice - The details related to a recurring (or subscription) price include the terms.
      Since:
      Offer Client 2.0.2
      See Also:
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional assortment of attributes that can be used for targeting by Offers.
      Specified by:
      setAttributes in interface LineItem
      Parameters:
      attributes - Additional, unspecified attributes.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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