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 LineItemImportDraftBuilderbuilder()builder factory method for LineItemImportDraftstatic LineItemImportDraftBuilderbuilder(LineItemImportDraft template) create builder for LineItemImportDraft instancecopyDeep()static LineItemImportDraftdeepCopy(LineItemImportDraft template) factory method to create a deep copy of LineItemImportDraft@Valid CustomFieldsDraftCustom Fields for the LineItem.@Valid ChannelResourceIdentifierThe Channel used to select a Price.Inventory mode specific to the LineItem, valid for the entirequantityof the LineItem.getKey()User-defined identifier of the Line Item.@NotNull @Valid LocalizedStringgetName()Name of the Line Item.@NotNull @Valid PriceDraftgetPrice()The Line Item price forquantity=1.idof the Product the Product Variant belongs to.@NotNull LongQuantity of the Product Variant.@Valid ItemShippingDetailsDraftContainer for Line Item-specific addresses.getState()States of the Line Item.@Valid ChannelResourceIdentifierThe Channel used to supply Line Items.@Valid TaxedPriceDraftTaxed price of the Line Item.@Valid TaxRateThe tax rate used to calculate thetaxedPriceof the Line Item iftaxedPriceis not provided.@NotNull @Valid ProductVariantImportDraftThe Product Variant to use as a Line Item.static LineItemImportDraftof()factory methodstatic LineItemImportDraftof(LineItemImportDraft template) factory method to create a shallow copy LineItemImportDraftvoidsetCustom(CustomFieldsDraft custom) Custom Fields for the LineItem.voidsetDistributionChannel(ChannelResourceIdentifier distributionChannel) The Channel used to select a Price.voidsetInventoryMode(InventoryMode inventoryMode) Inventory mode specific to the LineItem, valid for the entirequantityof the LineItem.voidUser-defined identifier of the Line Item.voidsetName(LocalizedString name) Name of the Line Item.voidsetPrice(PriceDraft price) The Line Item price forquantity=1.voidsetProductId(String productId) idof the Product the Product Variant belongs to.voidsetQuantity(Long quantity) Quantity of the Product Variant.voidsetShippingDetails(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.voidStates of the Line Item.voidStates of the Line Item.voidsetSupplyChannel(ChannelResourceIdentifier supplyChannel) The Channel used to supply Line Items.voidsetTaxedPrice(TaxedPriceDraft taxedPrice) Taxed price of the Line Item.voidsetTaxRate(TaxRate taxRate) The tax rate used to calculate thetaxedPriceof the Line Item iftaxedPriceis not provided.voidsetVariant(ProductVariantImportDraft variant) The Product Variant to use as a Line Item.static tools.jackson.core.type.TypeReference<LineItemImportDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithLineItemImportDraft(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 identifier of the Line Item. Must be unique among Line Items in the Order.
- Returns:
- key
-
getVariant
The Product Variant to use as a Line Item.
- Returns:
- variant
-
getProductId
String getProductId()idof the Product the Product Variant belongs to.If provided, you must also set
variant.id.- Returns:
- productId
-
getQuantity
Quantity of the Product Variant. 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
taxedPriceof the Line Item iftaxedPriceis not provided.- Returns:
- taxRate
-
getTaxedPrice
Taxed price of the Line Item. If provided, the values are stored as-is on the resulting LineItem instead of being derived from
price,quantity, andtaxRate.Can only be set if
taxRateis also set.- Returns:
- taxedPrice
-
getDistributionChannel
The Channel used to select a Price. This Channel must have the
ProductDistributionrole.- 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
InventorySupplyrole.- Returns:
- supplyChannel
-
getInventoryMode
InventoryMode getInventoryMode()Inventory mode specific to the LineItem, valid for the entire
quantityof the LineItem. Set only if Inventory mode should be different from theinventoryModespecified 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 for the LineItem.
- Specified by:
getCustomin interfaceCustomizableDraft<LineItemImportDraft>- Returns:
- custom
-
setName
Name of the Line Item.
- Parameters:
name- value to be set
-
setKey
User-defined identifier of the Line Item. Must be unique among Line Items in the Order.
- Parameters:
key- value to be set
-
setVariant
The Product Variant to use as a Line Item.
- Parameters:
variant- value to be set
-
setProductId
idof the Product the Product Variant belongs to.If provided, you must also set
variant.id.- Parameters:
productId- value to be set
-
setQuantity
Quantity of the Product Variant. 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
taxedPriceof the Line Item iftaxedPriceis not provided.- Parameters:
taxRate- value to be set
-
setTaxedPrice
Taxed price of the Line Item. If provided, the values are stored as-is on the resulting LineItem instead of being derived from
price,quantity, andtaxRate.Can only be set if
taxRateis also set.- Parameters:
taxedPrice- value to be set
-
setDistributionChannel
The Channel used to select a Price. This Channel must have the
ProductDistributionrole.- 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
InventorySupplyrole.- Parameters:
supplyChannel- value to be set
-
setInventoryMode
Inventory mode specific to the LineItem, valid for the entire
quantityof the LineItem. Set only if Inventory mode should be different from theinventoryModespecified 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 for the LineItem.
- Specified by:
setCustomin 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
-
copyDeep
LineItemImportDraft copyDeep() -
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
-