public class LineItem
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static LineItem |
create(java.lang.String id,
java.lang.String productId,
LocalizedString productName,
Variant variant,
int quantity,
Price price,
com.google.common.base.Optional<DiscountedLineItemPrice> discountedPrice,
TaxRate taxRate,
Reference<Channel> supplyChannel) |
static LineItem |
create(java.lang.String id,
java.lang.String productId,
LocalizedString productName,
Variant variant,
int quantity,
Price price,
TaxRate taxRate,
Reference<Channel> supplyChannel) |
com.google.common.base.Optional<DiscountedLineItemPrice> |
getDiscountedPrice() |
java.lang.String |
getId()
Unique id of this line item.
|
Price |
getPrice()
The price.
|
java.lang.String |
getProductId()
Unique id of the product.
|
java.lang.String |
getProductName()
Name of the product.
|
java.lang.String |
getProductName(java.util.Locale locale) |
int |
getQuantity()
Number of items ordered.
|
Reference<Channel> |
getSupplyChannel()
The optional assigned Channel for this LineItem.
|
TaxRate |
getTaxRate()
The tax rate of this line item.
|
Money |
getTotalPrice()
The total price of this line item, that is price value times quantity.
|
Money |
getTotalPriceBeforeDiscount()
The total price of this line item before discount, that is price value times quantity.
|
Money |
getUnitPrice()
The base price of this line item, for single unit.
|
Money |
getUnitPriceBeforeDiscount()
The base price of this line item before discount, for single unit.
|
Variant |
getVariant()
Copy of the product variant from the time when time line item was created.
|
java.lang.String |
toString() |
public static LineItem create(java.lang.String id, java.lang.String productId, LocalizedString productName, Variant variant, int quantity, Price price, com.google.common.base.Optional<DiscountedLineItemPrice> discountedPrice, TaxRate taxRate, Reference<Channel> supplyChannel)
public static LineItem create(java.lang.String id, java.lang.String productId, LocalizedString productName, Variant variant, int quantity, Price price, TaxRate taxRate, Reference<Channel> supplyChannel)
@Nonnull public java.lang.String getId()
@Nonnull public java.lang.String getProductId()
@Nonnull public java.lang.String getProductName()
@Nonnull public java.lang.String getProductName(java.util.Locale locale)
locale
- @Nonnull public Variant getVariant()
public int getQuantity()
@Nonnull public Money getTotalPrice()
@Nonnull public Money getUnitPrice()
@Nonnull public Money getTotalPriceBeforeDiscount()
@Nonnull public Money getUnitPriceBeforeDiscount()
@Nonnull public Price getPrice()
public com.google.common.base.Optional<DiscountedLineItemPrice> getDiscountedPrice()
@Nullable public TaxRate getTaxRate()
The tax rate is selected based on the cart's shipping address and is only set when the shipping address is set.
public Reference<Channel> getSupplyChannel()
public java.lang.String toString()
toString
in class java.lang.Object