Interface LineItemImportDraft
- All Superinterfaces:
CustomizableDraft<LineItemImportDraft>
,Draft<LineItemImportDraft>
Represents a snapshot of a Product Variant at the time it was imported with the Order. The Product Variant can be specified by providing a productId
and variant.id
, or by providing a variant.sku
.
Example to create an instance using the builder pattern
LineItemImportDraft lineItemImportDraft = LineItemImportDraft.builder()
.name(nameBuilder -> nameBuilder)
.variant(variantBuilder -> variantBuilder)
.quantity(0.3)
.price(priceBuilder -> priceBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic LineItemImportDraftBuilder
builder()
builder factory method for LineItemImportDraftstatic LineItemImportDraftBuilder
builder
(LineItemImportDraft template) create builder for LineItemImportDraft instancestatic LineItemImportDraft
deepCopy
(LineItemImportDraft template) factory method to create a deep copy of LineItemImportDraft@Valid CustomFieldsDraft
Custom Fields of the LineItem.@Valid ChannelResourceIdentifier
The Channel used to select a Price.Inventory mode specific to the LineItem, valid for the entirequantity
of the LineItem.getKey()
User-defined unique identifier of the Line Item.@NotNull @Valid LocalizedString
getName()
Name of the Line Item.@NotNull @Valid PriceDraft
getPrice()
The Line Item price forquantity
=1
.id
of the Product the Product Variant belongs to.@NotNull Long
The number of Product Variants in the LineItem.@Valid ItemShippingDetailsDraft
Container for Line Item-specific addresses.getState()
States of the Line Item.@Valid ChannelResourceIdentifier
The Channel used to supply Line Items.@Valid TaxRate
The tax rate used to calculate thetaxedPrice
of the Order.@NotNull @Valid ProductVariantImportDraft
The Product Variant to use as a Line Item.static LineItemImportDraft
of()
factory methodstatic LineItemImportDraft
of
(LineItemImportDraft template) factory method to create a shallow copy LineItemImportDraftvoid
setCustom
(CustomFieldsDraft custom) Custom Fields of the LineItem.void
setDistributionChannel
(ChannelResourceIdentifier distributionChannel) The Channel used to select a Price.void
setInventoryMode
(InventoryMode inventoryMode) Inventory mode specific to the LineItem, valid for the entirequantity
of the LineItem.void
User-defined unique identifier of the Line Item.void
setName
(LocalizedString name) Name of the Line Item.void
setPrice
(PriceDraft price) The Line Item price forquantity
=1
.void
setProductId
(String productId) id
of the Product the Product Variant belongs to.void
setQuantity
(Long quantity) The number of Product Variants in the LineItem.void
setShippingDetails
(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.void
States of the Line Item.void
States of the Line Item.void
setSupplyChannel
(ChannelResourceIdentifier supplyChannel) The Channel used to supply Line Items.void
setTaxRate
(TaxRate taxRate) The tax rate used to calculate thetaxedPrice
of the Order.void
setVariant
(ProductVariantImportDraft variant) The Product Variant to use as a Line Item.static com.fasterxml.jackson.core.type.TypeReference<LineItemImportDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withLineItemImportDraft
(Function<LineItemImportDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getName
Name of the Line Item.
- Returns:
- name
-
getKey
String getKey()User-defined unique identifier of the Line Item.
- Returns:
- key
-
getVariant
The Product Variant to use as a Line Item.
- Returns:
- variant
-
getProductId
String getProductId()id
of the Product the Product Variant belongs to.If provided, you must also set
variant.id
.- Returns:
- productId
-
getQuantity
The number of Product Variants in the LineItem. Can be a negative value.
- Returns:
- quantity
-
getPrice
The Line Item price for
quantity
=1
. The amount can be negative.- Returns:
- price
-
getTaxRate
The tax rate used to calculate the
taxedPrice
of the Order.- Returns:
- taxRate
-
getDistributionChannel
The Channel used to select a Price. This Channel must have the
ProductDistribution
role.- Returns:
- distributionChannel
-
getSupplyChannel
The Channel used to supply Line Items. By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. This Channel must have the
InventorySupply
role.- Returns:
- supplyChannel
-
getInventoryMode
InventoryMode getInventoryMode()Inventory mode specific to the LineItem, valid for the entire
quantity
of the LineItem. Set only if Inventory mode should be different from theinventoryMode
specified on the OrderImportDraft.- Returns:
- inventoryMode
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getState
States of the Line Item.
- Returns:
- state
-
getCustom
Custom Fields of the LineItem.
- Specified by:
getCustom
in interfaceCustomizableDraft<LineItemImportDraft>
- Returns:
- custom
-
setName
Name of the Line Item.
- Parameters:
name
- value to be set
-
setKey
User-defined unique identifier of the Line Item.
- Parameters:
key
- value to be set
-
setVariant
The Product Variant to use as a Line Item.
- Parameters:
variant
- value to be set
-
setProductId
id
of the Product the Product Variant belongs to.If provided, you must also set
variant.id
.- Parameters:
productId
- value to be set
-
setQuantity
The number of Product Variants in the LineItem. Can be a negative value.
- Parameters:
quantity
- value to be set
-
setPrice
The Line Item price for
quantity
=1
. The amount can be negative.- Parameters:
price
- value to be set
-
setTaxRate
The tax rate used to calculate the
taxedPrice
of the Order.- Parameters:
taxRate
- value to be set
-
setDistributionChannel
The Channel used to select a Price. This Channel must have the
ProductDistribution
role.- Parameters:
distributionChannel
- value to be set
-
setSupplyChannel
The Channel used to supply Line Items. By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. This Channel must have the
InventorySupply
role.- Parameters:
supplyChannel
- value to be set
-
setInventoryMode
Inventory mode specific to the LineItem, valid for the entire
quantity
of the LineItem. Set only if Inventory mode should be different from theinventoryMode
specified on the OrderImportDraft.- Parameters:
inventoryMode
- value to be set
-
setShippingDetails
Container for Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set
-
setState
States of the Line Item.
- Parameters:
state
- values to be set
-
setState
States of the Line Item.
- Parameters:
state
- values to be set
-
setCustom
Custom Fields of the LineItem.
- Specified by:
setCustom
in interfaceCustomizableDraft<LineItemImportDraft>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of LineItemImportDraft
-
of
factory method to create a shallow copy LineItemImportDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of LineItemImportDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for LineItemImportDraft- Returns:
- builder
-
builder
create builder for LineItemImportDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withLineItemImportDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-