Interface ShoppingListLineItemDraft
- All Superinterfaces:
CustomizableDraft<ShoppingListLineItemDraft>
,Draft<ShoppingListLineItemDraft>
The ProductVariant to be included in the ShoppingListLineItem must be specified using the productID
and variantID
, or by the sku
.
Example to create an instance using the builder pattern
ShoppingListLineItemDraft shoppingListLineItemDraft = ShoppingListLineItemDraft.builder()
.build()
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ShoppingListLineItemDraftbuilder
(ShoppingListLineItemDraft template) create builder for ShoppingListLineItemDraft instancestatic ShoppingListLineItemDraft
deepCopy
(ShoppingListLineItemDraft template) factory method to create a deep copy of ShoppingListLineItemDraftDate and time the ShoppingListLineItem is added to the ShoppingList.@Valid CustomFieldsDraft
Custom Fields of the ShoppingListLineItem.getKey()
User-defined identifier of the ShoppingListLineItem.Unique identifier of a Product.Number of Products in the ShoppingListLineItem.getSku()
sku
of the ProductVariant.id
of the ProductVariant.static ShoppingListLineItemDraft
of()
factory methodstatic ShoppingListLineItemDraft
of
(ShoppingListLineItemDraft template) factory method to create a shallow copy ShoppingListLineItemDraftvoid
setAddedAt
(ZonedDateTime addedAt) Date and time the ShoppingListLineItem is added to the ShoppingList.void
setCustom
(CustomFieldsDraft custom) Custom Fields of the ShoppingListLineItem.void
User-defined identifier of the ShoppingListLineItem.void
setProductId
(String productId) Unique identifier of a Product.void
setQuantity
(Long quantity) Number of Products in the ShoppingListLineItem.void
sku
of the ProductVariant.void
setVariantId
(Long variantId) id
of the ProductVariant.static com.fasterxml.jackson.core.type.TypeReference<ShoppingListLineItemDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
String getKey()User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.
- Returns:
- key
-
getProductId
String getProductId()Unique identifier of a Product.
- Returns:
- productId
-
getVariantId
Long getVariantId()id
of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.- Returns:
- variantId
-
getSku
String getSku()sku
of the ProductVariant.- Returns:
- sku
-
getAddedAt
ZonedDateTime getAddedAt()Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.
- Returns:
- addedAt
-
getCustom
Custom Fields of the ShoppingListLineItem.
- Specified by:
getCustom
in interfaceCustomizableDraft<ShoppingListLineItemDraft>
- Returns:
- custom
-
getQuantity
Long getQuantity()Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
setKey
User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.
- Parameters:
key
- value to be set
-
setProductId
Unique identifier of a Product.
- Parameters:
productId
- value to be set
-
setVariantId
id
of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.- Parameters:
variantId
- value to be set
-
setSku
sku
of the ProductVariant.- Parameters:
sku
- value to be set
-
setAddedAt
Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.
- Parameters:
addedAt
- value to be set
-
setCustom
Custom Fields of the ShoppingListLineItem.
- Specified by:
setCustom
in interfaceCustomizableDraft<ShoppingListLineItemDraft>
- Parameters:
custom
- value to be set
-
setQuantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity
- value to be set
-
of
factory method- Returns:
- instance of ShoppingListLineItemDraft
-
of
factory method to create a shallow copy ShoppingListLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ShoppingListLineItemDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShoppingListLineItemDraft- Returns:
- builder
-
builder
create builder for ShoppingListLineItemDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withShoppingListLineItemDraft
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
-