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 of 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 unique 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 LongThe number of Product Variants in the LineItem.@Valid ItemShippingDetailsDraftContainer for Line Item-specific addresses.getState()States of the Line Item.@Valid ChannelResourceIdentifierThe Channel used to supply Line Items.@Valid TaxRateThe tax rate used to calculate thetaxedPriceof the Order.@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 of 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 unique 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) The number of Product Variants in the LineItem.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.voidsetTaxRate(TaxRate taxRate) The tax rate used to calculate thetaxedPriceof the Order.voidsetVariant(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> 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 unique identifier of the Line Item.
- 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
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
taxedPriceof the Order.- Returns:
- taxRate
-
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 of the LineItem.
- Specified by:
getCustomin 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
idof 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
taxedPriceof the Order.- Parameters:
taxRate- 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 of 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
-