Interface MyLineItemDraft
- All Superinterfaces:
CustomizableDraft<MyLineItemDraft>,Draft<MyLineItemDraft>
For Product Variant identification, either the productId and variantId, or sku must be provided.
Example to create an instance using the builder pattern
MyLineItemDraft myLineItemDraft = MyLineItemDraft.builder()
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic MyLineItemDraftBuilderbuilder()builder factory method for MyLineItemDraftstatic MyLineItemDraftBuilderbuilder(MyLineItemDraft template) create builder for MyLineItemDraft instancecopyDeep()static MyLineItemDraftdeepCopy(MyLineItemDraft template) factory method to create a deep copy of MyLineItemDraftDate and time (UTC) the Product Variant is added to the Cart.@Valid CustomFieldsDraftCustom Fields for the Cart.@Valid ChannelResourceIdentifierUsed to select a Product Price.getKey()User-defined unique identifier of the LineItem.idof the Product.Number of Product Variants to add to the Cart.@Valid LineItemRecurrenceInfoDraftRecurring Order and frequency data.@Valid ItemShippingDetailsDraftContainer for Line Item-specific addresses.getSku()skuof the ProductVariant.@Valid ChannelResourceIdentifierUsed to identify Inventory entries that must be reserved.idof the ProductVariant in the Product.static MyLineItemDraftof()factory methodstatic MyLineItemDraftof(MyLineItemDraft template) factory method to create a shallow copy MyLineItemDraftvoidsetAddedAt(ZonedDateTime addedAt) Date and time (UTC) the Product Variant is added to the Cart.voidsetCustom(CustomFieldsDraft custom) Custom Fields for the Cart.voidsetDistributionChannel(ChannelResourceIdentifier distributionChannel) Used to select a Product Price.voidUser-defined unique identifier of the LineItem.voidsetProductId(String productId) idof the Product.voidsetQuantity(Long quantity) Number of Product Variants to add to the Cart.voidsetRecurrenceInfo(LineItemRecurrenceInfoDraft recurrenceInfo) Recurring Order and frequency data.voidsetShippingDetails(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.voidskuof the ProductVariant.voidsetSupplyChannel(ChannelResourceIdentifier supplyChannel) Used to identify Inventory entries that must be reserved.voidsetVariantId(Long variantId) idof the ProductVariant in the Product.static com.fasterxml.jackson.core.type.TypeReference<MyLineItemDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithMyLineItemDraft(Function<MyLineItemDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
String getKey()User-defined unique identifier of the LineItem.
- Returns:
- key
-
getProductId
String getProductId()idof the Product.- Returns:
- productId
-
getVariantId
Long getVariantId()idof the ProductVariant in the Product. If not provided, the Master Variant is used.- Returns:
- variantId
-
getSku
String getSku()skuof the ProductVariant.- Returns:
- sku
-
getQuantity
Long getQuantity()Number of Product Variants to add to the Cart.
- Returns:
- quantity
-
getAddedAt
ZonedDateTime getAddedAt()Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Returns:
- addedAt
-
getSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Returns:
- supplyChannel
-
getDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum.If the Cart is bound to a Store with
distributionChannelsset, the Channel must match one of the Store's distribution channels.- Returns:
- distributionChannel
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getRecurrenceInfo
Recurring Order and frequency data.
- Returns:
- recurrenceInfo
-
getCustom
Custom Fields for the Cart.
- Specified by:
getCustomin interfaceCustomizableDraft<MyLineItemDraft>- Returns:
- custom
-
setKey
User-defined unique identifier of the LineItem.
- Parameters:
key- value to be set
-
setProductId
idof the Product.- Parameters:
productId- value to be set
-
setVariantId
idof the ProductVariant in the Product. If not provided, the Master Variant is used.- Parameters:
variantId- value to be set
-
setSku
skuof the ProductVariant.- Parameters:
sku- value to be set
-
setQuantity
Number of Product Variants to add to the Cart.
- Parameters:
quantity- value to be set
-
setAddedAt
Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Parameters:
addedAt- value to be set
-
setSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupplyChannelRoleEnum.- Parameters:
supplyChannel- value to be set
-
setDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistributionChannelRoleEnum.If the Cart is bound to a Store with
distributionChannelsset, the Channel must match one of the Store's distribution channels.- Parameters:
distributionChannel- value to be set
-
setShippingDetails
Container for Line Item-specific addresses.
- Parameters:
shippingDetails- value to be set
-
setRecurrenceInfo
Recurring Order and frequency data.
- Parameters:
recurrenceInfo- value to be set
-
setCustom
Custom Fields for the Cart.
- Specified by:
setCustomin interfaceCustomizableDraft<MyLineItemDraft>- Parameters:
custom- value to be set
-
of
factory method- Returns:
- instance of MyLineItemDraft
-
of
factory method to create a shallow copy MyLineItemDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
MyLineItemDraft copyDeep() -
deepCopy
factory method to create a deep copy of MyLineItemDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for MyLineItemDraft- Returns:
- builder
-
builder
create builder for MyLineItemDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withMyLineItemDraft
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
-