Class LineItemImpl
- All Implemented Interfaces:
LineItem
,Customizable<LineItem>
,io.vrap.rmf.base.client.ModelBase
The representation of a Line Item in a Cart or in an Order.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Date and time (UTC) the Line Item was added to the Cart.Custom Fields of the Line Item.Discounted price of a single quantity of the Line Item.Used to select a Product Price.getId()
Unique identifier of the LineItem.Inventory mode specific to this Line Item only, and valid for the entirequantity
of the Line Item.getKey()
User-defined unique identifier of the LineItem.Date and time (UTC) the Line Item was last updated.Indicates how the Line Item is added to the Cart.getName()
Name of the Product.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.getPrice()
Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.Indicates how the Price for the Line Item is set.id
of the Product the Line Item is based on.key
of the Product.slug
of the current version of the Product.Product Type of the Product.Number of Line Items of the given Product Variant present in the Cart or Order.Container for Line Item-specific addresses.getState()
State of the Line Item in the Cart or the Order.Identifies Inventory entries that are reserved.Automatically set aftertaxRate
is set.Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.Total price of this Line Item equallingprice
multiplied byquantity
.Holds the data of the Product Variant added to the Cart.int
hashCode()
void
setAddedAt
(ZonedDateTime addedAt) Date and time (UTC) the Line Item was added to the Cart.void
setCustom
(CustomFields custom) Custom Fields of the Line Item.void
setDiscountedPricePerQuantity
(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.void
setDiscountedPricePerQuantity
(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.void
setDistributionChannel
(ChannelReference distributionChannel) Used to select a Product Price.void
Unique identifier of the LineItem.void
setInventoryMode
(InventoryMode inventoryMode) Inventory mode specific to this Line Item only, and valid for the entirequantity
of the Line Item.void
User-defined unique identifier of the LineItem.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Line Item was last updated.void
setLineItemMode
(LineItemMode lineItemMode) Indicates how the Line Item is added to the Cart.void
setName
(LocalizedString name) Name of the Product.void
setPerMethodTaxRate
(MethodTaxRate... perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.void
setPerMethodTaxRate
(List<MethodTaxRate> perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.void
Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.void
setPriceMode
(LineItemPriceMode priceMode) Indicates how the Price for the Line Item is set.void
setProductId
(String productId) id
of the Product the Line Item is based on.void
setProductKey
(String productKey) key
of the Product.void
setProductSlug
(LocalizedString productSlug) slug
of the current version of the Product.void
setProductType
(ProductTypeReference productType) Product Type of the Product.void
setQuantity
(Long quantity) Number of Line Items of the given Product Variant present in the Cart or Order.void
setShippingDetails
(ItemShippingDetails shippingDetails) Container for Line Item-specific addresses.void
State of the Line Item in the Cart or the Order.void
State of the Line Item in the Cart or the Order.void
setSupplyChannel
(ChannelReference supplyChannel) Identifies Inventory entries that are reserved.void
setTaxedPrice
(TaxedItemPrice taxedPrice) Automatically set aftertaxRate
is set.void
setTaxedPricePortions
(MethodTaxedPrice... taxedPricePortions) Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.void
setTaxedPricePortions
(List<MethodTaxedPrice> taxedPricePortions) Taxed price of the Shipping Method that is automatically set afterperMethodTaxRate
is set.void
setTaxRate
(TaxRate taxRate) For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.void
setTotalPrice
(CentPrecisionMoney totalPrice) Total price of this Line Item equallingprice
multiplied byquantity
.void
setVariant
(ProductVariant variant) Holds the data of the Product Variant added to the Cart.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.Customizable
unwrapCustomizable
Methods inherited from interface com.commercetools.api.models.cart.LineItem
withLineItem
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
-
Constructor Details
-
LineItemImpl
public LineItemImpl()create empty instance
-
-
Method Details
-
getId
Unique identifier of the LineItem.
-
getKey
User-defined unique identifier of the LineItem.
-
getProductId
id
of the Product the Line Item is based on.- Specified by:
getProductId
in interfaceLineItem
- Returns:
- productId
-
getProductKey
key
of the Product.This field is only present on:
- Line Items in a Cart when the
key
is available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
key
is available on the specific Product at the time the Order was created from the Cart.
Present on resources created or updated after 3 December 2021.
- Specified by:
getProductKey
in interfaceLineItem
- Returns:
- productKey
- Line Items in a Cart when the
-
getName
Name of the Product.
-
getProductSlug
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Specified by:
getProductSlug
in interfaceLineItem
- Returns:
- productSlug
-
getProductType
Product Type of the Product.
- Specified by:
getProductType
in interfaceLineItem
- Returns:
- productType
-
getVariant
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Specified by:
getVariant
in interfaceLineItem
- Returns:
- variant
-
getPrice
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
. -
getQuantity
Number of Line Items of the given Product Variant present in the Cart or Order.
- Specified by:
getQuantity
in interfaceLineItem
- Returns:
- quantity
-
getTotalPrice
Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Specified by:
getTotalPrice
in interfaceLineItem
- Returns:
- totalPrice
-
getDiscountedPricePerQuantity
Discounted price of a single quantity of the Line Item.
- Specified by:
getDiscountedPricePerQuantity
in interfaceLineItem
- Returns:
- discountedPricePerQuantity
-
getTaxedPrice
Automatically set after
taxRate
is set.- Specified by:
getTaxedPrice
in interfaceLineItem
- Returns:
- taxedPrice
-
getTaxedPricePortions
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
getTaxedPricePortions
in interfaceLineItem
- Returns:
- taxedPricePortions
-
getState
State of the Line Item in the Cart or the Order.
-
getTaxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Specified by:
getTaxRate
in interfaceLineItem
- Returns:
- taxRate
- For a Cart with
-
getPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
getPerMethodTaxRate
in interfaceLineItem
- Returns:
- perMethodTaxRate
-
getSupplyChannel
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Specified by:
getSupplyChannel
in interfaceLineItem
- Returns:
- supplyChannel
-
getDistributionChannel
Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Specified by:
getDistributionChannel
in interfaceLineItem
- Returns:
- distributionChannel
-
getPriceMode
Indicates how the Price for the Line Item is set.
- Specified by:
getPriceMode
in interfaceLineItem
- Returns:
- priceMode
-
getLineItemMode
Indicates how the Line Item is added to the Cart.
- Specified by:
getLineItemMode
in interfaceLineItem
- Returns:
- lineItemMode
-
getInventoryMode
Inventory mode specific to this Line Item only, and valid for the entire
quantity
of the Line Item. Only present if the inventory mode is different from theinventoryMode
specified on the Cart.- Specified by:
getInventoryMode
in interfaceLineItem
- Returns:
- inventoryMode
-
getShippingDetails
Container for Line Item-specific addresses.
- Specified by:
getShippingDetails
in interfaceLineItem
- Returns:
- shippingDetails
-
getCustom
Custom Fields of the Line Item.
- Specified by:
getCustom
in interfaceCustomizable<LineItem>
- Specified by:
getCustom
in interfaceLineItem
- Returns:
- custom
-
getAddedAt
Date and time (UTC) the Line Item was added to the Cart.
- Specified by:
getAddedAt
in interfaceLineItem
- Returns:
- addedAt
-
getLastModifiedAt
Date and time (UTC) the Line Item was last updated.
- Specified by:
getLastModifiedAt
in interfaceLineItem
- Returns:
- lastModifiedAt
-
setId
Description copied from interface:LineItem
Unique identifier of the LineItem.
-
setKey
Description copied from interface:LineItem
User-defined unique identifier of the LineItem.
-
setProductId
Description copied from interface:LineItem
id
of the Product the Line Item is based on.- Specified by:
setProductId
in interfaceLineItem
- Parameters:
productId
- value to be set
-
setProductKey
Description copied from interface:LineItem
key
of the Product.This field is only present on:
- Line Items in a Cart when the
key
is available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
key
is available on the specific Product at the time the Order was created from the Cart.
Present on resources created or updated after 3 December 2021.
- Specified by:
setProductKey
in interfaceLineItem
- Parameters:
productKey
- value to be set
- Line Items in a Cart when the
-
setName
Description copied from interface:LineItem
Name of the Product.
-
setProductSlug
Description copied from interface:LineItem
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Specified by:
setProductSlug
in interfaceLineItem
- Parameters:
productSlug
- value to be set
-
setProductType
Description copied from interface:LineItem
Product Type of the Product.
- Specified by:
setProductType
in interfaceLineItem
- Parameters:
productType
- value to be set
-
setVariant
Description copied from interface:LineItem
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Specified by:
setVariant
in interfaceLineItem
- Parameters:
variant
- value to be set
-
setPrice
Description copied from interface:LineItem
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
. -
setQuantity
Description copied from interface:LineItem
Number of Line Items of the given Product Variant present in the Cart or Order.
- Specified by:
setQuantity
in interfaceLineItem
- Parameters:
quantity
- value to be set
-
setTotalPrice
Description copied from interface:LineItem
Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Specified by:
setTotalPrice
in interfaceLineItem
- Parameters:
totalPrice
- value to be set
-
setDiscountedPricePerQuantity
public void setDiscountedPricePerQuantity(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Description copied from interface:LineItem
Discounted price of a single quantity of the Line Item.
- Specified by:
setDiscountedPricePerQuantity
in interfaceLineItem
- Parameters:
discountedPricePerQuantity
- values to be set
-
setDiscountedPricePerQuantity
public void setDiscountedPricePerQuantity(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Description copied from interface:LineItem
Discounted price of a single quantity of the Line Item.
- Specified by:
setDiscountedPricePerQuantity
in interfaceLineItem
- Parameters:
discountedPricePerQuantity
- values to be set
-
setTaxedPrice
Description copied from interface:LineItem
Automatically set after
taxRate
is set.- Specified by:
setTaxedPrice
in interfaceLineItem
- Parameters:
taxedPrice
- value to be set
-
setTaxedPricePortions
Description copied from interface:LineItem
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
setTaxedPricePortions
in interfaceLineItem
- Parameters:
taxedPricePortions
- values to be set
-
setTaxedPricePortions
Description copied from interface:LineItem
Taxed price of the Shipping Method that is automatically set after
perMethodTaxRate
is set.- Specified by:
setTaxedPricePortions
in interfaceLineItem
- Parameters:
taxedPricePortions
- values to be set
-
setState
Description copied from interface:LineItem
State of the Line Item in the Cart or the Order.
-
setState
Description copied from interface:LineItem
State of the Line Item in the Cart or the Order.
-
setTaxRate
Description copied from interface:LineItem
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Specified by:
setTaxRate
in interfaceLineItem
- Parameters:
taxRate
- value to be set
- For a Cart with
-
setPerMethodTaxRate
Description copied from interface:LineItem
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
setPerMethodTaxRate
in interfaceLineItem
- Parameters:
perMethodTaxRate
- values to be set
-
setPerMethodTaxRate
Description copied from interface:LineItem
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Specified by:
setPerMethodTaxRate
in interfaceLineItem
- Parameters:
perMethodTaxRate
- values to be set
-
setSupplyChannel
Description copied from interface:LineItem
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Specified by:
setSupplyChannel
in interfaceLineItem
- Parameters:
supplyChannel
- value to be set
-
setDistributionChannel
Description copied from interface:LineItem
Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Specified by:
setDistributionChannel
in interfaceLineItem
- Parameters:
distributionChannel
- value to be set
-
setPriceMode
Description copied from interface:LineItem
Indicates how the Price for the Line Item is set.
- Specified by:
setPriceMode
in interfaceLineItem
- Parameters:
priceMode
- value to be set
-
setLineItemMode
Description copied from interface:LineItem
Indicates how the Line Item is added to the Cart.
- Specified by:
setLineItemMode
in interfaceLineItem
- Parameters:
lineItemMode
- value to be set
-
setInventoryMode
Description copied from interface:LineItem
Inventory mode specific to this Line Item only, and valid for the entire
quantity
of the Line Item. Only present if the inventory mode is different from theinventoryMode
specified on the Cart.- Specified by:
setInventoryMode
in interfaceLineItem
- Parameters:
inventoryMode
- value to be set
-
setShippingDetails
Description copied from interface:LineItem
Container for Line Item-specific addresses.
- Specified by:
setShippingDetails
in interfaceLineItem
- Parameters:
shippingDetails
- value to be set
-
setCustom
Description copied from interface:LineItem
Custom Fields of the Line Item.
- Specified by:
setCustom
in interfaceCustomizable<LineItem>
- Specified by:
setCustom
in interfaceLineItem
- Parameters:
custom
- value to be set
-
setAddedAt
Description copied from interface:LineItem
Date and time (UTC) the Line Item was added to the Cart.
- Specified by:
setAddedAt
in interfaceLineItem
- Parameters:
addedAt
- value to be set
-
setLastModifiedAt
Description copied from interface:LineItem
Date and time (UTC) the Line Item was last updated.
- Specified by:
setLastModifiedAt
in interfaceLineItem
- Parameters:
lastModifiedAt
- value to be set
-
equals
-
hashCode
-