Class LineItem
java.lang.Object
com.commercetools.graphql.api.types.LineItem
A line item is a snapshot of a product variant at the time it was added to the cart.
Since a product variant may change at any time, the ProductVariant data is copied into the field variant.
The relation to the Product is kept but the line item will not automatically update if the product variant changes.
On the cart, the line item can be updated manually. The productSlug refers to the current version of the product.
It can be used to link to the product. If the product has been deleted, the line item remains but refers to a
non-existent product and the productSlug is left empty.
Please also note that creating an order is impossible if the product or product variant a line item relates to has been deleted.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionLineItem()LineItem(String id, String key, String productId, String productKey, String name, List<LocalizedString> nameAllLocales, String productSlug, List<LocalizedString> productSlugAllLocales, ProductTypeDefinition productType, Reference productTypeRef, ProductVariant variant, ProductPrice price, TaxedItemPrice taxedPrice, Money totalPrice, Long quantity, OffsetDateTime addedAt, OffsetDateTime lastModifiedAt, List<ItemState> state, TaxRate taxRate, Channel supplyChannel, Reference supplyChannelRef, Channel distributionChannel, Reference distributionChannelRef, List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity, LineItemMode lineItemMode, LineItemPriceMode priceMode, CustomFieldsType custom, InventoryMode inventoryMode, ItemShippingDetails shippingDetails, List<MethodTaxRate> perMethodTaxRate, List<MethodTaxedPrice> taxedPricePortions) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()getKey()getName()getPrice()getState()inthashCode()static LineItem.BuildervoidsetAddedAt(OffsetDateTime addedAt) voidsetCustom(CustomFieldsType custom) voidsetDiscountedPricePerQuantity(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) voidsetDistributionChannel(Channel distributionChannel) voidsetDistributionChannelRef(Reference distributionChannelRef) voidvoidsetInventoryMode(InventoryMode inventoryMode) voidvoidsetLastModifiedAt(OffsetDateTime lastModifiedAt) voidsetLineItemMode(LineItemMode lineItemMode) voidvoidsetNameAllLocales(List<LocalizedString> nameAllLocales) voidsetPerMethodTaxRate(List<MethodTaxRate> perMethodTaxRate) voidsetPrice(ProductPrice price) voidsetPriceMode(LineItemPriceMode priceMode) voidsetProductId(String productId) voidsetProductKey(String productKey) voidsetProductSlug(String productSlug) voidsetProductSlugAllLocales(List<LocalizedString> productSlugAllLocales) voidsetProductType(ProductTypeDefinition productType) voidsetProductTypeRef(Reference productTypeRef) voidsetQuantity(Long quantity) voidsetShippingDetails(ItemShippingDetails shippingDetails) voidvoidsetSupplyChannel(Channel supplyChannel) voidsetSupplyChannelRef(Reference supplyChannelRef) voidsetTaxedPrice(TaxedItemPrice taxedPrice) voidsetTaxedPricePortions(List<MethodTaxedPrice> taxedPricePortions) voidsetTaxRate(TaxRate taxRate) voidsetTotalPrice(Money totalPrice) voidsetVariant(ProductVariant variant) toString()
-
Constructor Details
-
LineItem
public LineItem() -
LineItem
public LineItem(String id, String key, String productId, String productKey, String name, List<LocalizedString> nameAllLocales, String productSlug, List<LocalizedString> productSlugAllLocales, ProductTypeDefinition productType, Reference productTypeRef, ProductVariant variant, ProductPrice price, TaxedItemPrice taxedPrice, Money totalPrice, Long quantity, OffsetDateTime addedAt, OffsetDateTime lastModifiedAt, List<ItemState> state, TaxRate taxRate, Channel supplyChannel, Reference supplyChannelRef, Channel distributionChannel, Reference distributionChannelRef, List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity, LineItemMode lineItemMode, LineItemPriceMode priceMode, CustomFieldsType custom, InventoryMode inventoryMode, ItemShippingDetails shippingDetails, List<MethodTaxRate> perMethodTaxRate, List<MethodTaxedPrice> taxedPricePortions)
-
-
Method Details
-
getId
-
setId
-
getKey
-
setKey
-
getProductId
-
setProductId
-
getProductKey
-
setProductKey
-
getName
-
setName
-
getNameAllLocales
-
setNameAllLocales
-
getProductSlug
-
setProductSlug
-
getProductSlugAllLocales
-
setProductSlugAllLocales
-
getProductType
-
setProductType
-
getProductTypeRef
-
setProductTypeRef
-
getVariant
-
setVariant
-
getPrice
-
setPrice
-
getTaxedPrice
-
setTaxedPrice
-
getTotalPrice
-
setTotalPrice
-
getQuantity
-
setQuantity
-
getAddedAt
-
setAddedAt
-
getLastModifiedAt
-
setLastModifiedAt
-
getState
-
setState
-
getTaxRate
-
setTaxRate
-
getSupplyChannel
-
setSupplyChannel
-
getSupplyChannelRef
-
setSupplyChannelRef
-
getDistributionChannel
-
setDistributionChannel
-
getDistributionChannelRef
-
setDistributionChannelRef
-
getDiscountedPricePerQuantity
-
setDiscountedPricePerQuantity
public void setDiscountedPricePerQuantity(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) -
getLineItemMode
-
setLineItemMode
-
getPriceMode
-
setPriceMode
-
getCustom
-
setCustom
-
getInventoryMode
-
setInventoryMode
-
getShippingDetails
-
setShippingDetails
-
getPerMethodTaxRate
-
setPerMethodTaxRate
-
getTaxedPricePortions
-
setTaxedPricePortions
-
toString
-
equals
-
hashCode
public int hashCode() -
newBuilder
-