io.sphere.sdk.carts.LineItem Maven / Gradle / Ivy
package io.sphere.sdk.carts;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.cartdiscounts.DiscountedLineItemPriceForQuantity;
import io.sphere.sdk.channels.Channel;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.orders.Order;
import io.sphere.sdk.products.Price;
import io.sphere.sdk.products.ProductVariant;
import io.sphere.sdk.taxcategories.TaxRate;
import io.sphere.sdk.types.CustomFields;
import javax.annotation.Nullable;
import javax.money.MonetaryAmount;
import java.util.List;
import java.util.Set;
/**
A line item is a snapshot of a product variant at the time it was added to the cart.
A LineItem can have {@link io.sphere.sdk.types.Custom custom fields}.
@see io.sphere.sdk.carts.commands.updateactions.AddLineItem
@see io.sphere.sdk.carts.commands.updateactions.RemoveLineItem
@see io.sphere.sdk.carts.commands.updateactions.ChangeLineItemQuantity
@see Order#getLineItems()
@see Cart#getLineItems()
*/
@JsonDeserialize(as=LineItemImpl.class)
public interface LineItem extends LineItemLike {
String getProductId();
LocalizedString getName();
ProductVariant getVariant();
Price getPrice();
Set getState();
@Nullable
TaxRate getTaxRate();
@Nullable
Reference getSupplyChannel();
@Nullable
Reference getDistributionChannel();
@Nullable
LocalizedString getProductSlug();
@Override
String getId();
@Override
Long getQuantity();
@Override
CustomFields getCustom();
@Override
MonetaryAmount getTotalPrice();
@Override
List getDiscountedPricePerQuantity();
static String resourceTypeId() {
return "line-item";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy