Interface ShoppingListAddLineItemAction
- All Superinterfaces:
CustomizableDraft<ShoppingListAddLineItemAction>
,ResourceUpdateAction<ShoppingListUpdateAction>
,ShoppingListUpdateAction
- All Known Implementing Classes:
ShoppingListAddLineItemActionImpl
The ProductVariant to be included in the ShoppingListLineItem must be specified using the productID
and variantID
, or by the sku
. If the ShoppingList already contains a ShoppingListLineItem for the same Product Variant with the same Custom Fields, then only the quantity of the existing ShoppingListLineItem is increased. A ShoppingListLineItem with an empty variantId
is not considered the same as a ShoppingListLineItem with a variantId
currently referring to the Master Variant.
Example to create an instance using the builder pattern
ShoppingListAddLineItemAction shoppingListAddLineItemAction = ShoppingListAddLineItemAction.builder()
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
discriminator value for ShoppingListAddLineItemAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for ShoppingListAddLineItemActionbuilder
(ShoppingListAddLineItemAction template) create builder for ShoppingListAddLineItemAction instancedeepCopy
(ShoppingListAddLineItemAction template) factory method to create a deep copy of ShoppingListAddLineItemActionDate and time the TextLineItem is added to the ShoppingList.@Valid CustomFieldsDraft
Custom Fields defined for the ShoppingListLineItem.Unique identifier of a Product.Number of Products in the ShoppingListLineItem.getSku()
sku
of the ProductVariant.id
of the ProductVariant.of()
factory methodof
(ShoppingListAddLineItemAction template) factory method to create a shallow copy ShoppingListAddLineItemActionvoid
setAddedAt
(ZonedDateTime addedAt) Date and time the TextLineItem is added to the ShoppingList.void
setCustom
(CustomFieldsDraft custom) Custom Fields defined for 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<ShoppingListAddLineItemAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
Methods inherited from interface com.commercetools.api.models.shopping_list.ShoppingListUpdateAction
getAction, withShoppingListUpdateAction
-
Field Details
-
ADD_LINE_ITEM
discriminator value for ShoppingListAddLineItemAction- See Also:
-
-
Method Details
-
getSku
sku
of the ProductVariant.- Returns:
- sku
-
getProductId
Unique identifier of a Product.
- Returns:
- productId
-
getVariantId
id
of the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.- Returns:
- variantId
-
getQuantity
Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
getAddedAt
Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.
- Returns:
- addedAt
-
getCustom
Custom Fields defined for the ShoppingListLineItem.
- Specified by:
getCustom
in interfaceCustomizableDraft<ShoppingListAddLineItemAction>
- Returns:
- custom
-
setSku
sku
of the ProductVariant.- Parameters:
sku
- 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
-
setQuantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity
- value to be set
-
setAddedAt
Date and time the TextLineItem 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 defined for the ShoppingListLineItem.
- Specified by:
setCustom
in interfaceCustomizableDraft<ShoppingListAddLineItemAction>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of ShoppingListAddLineItemAction
-
of
factory method to create a shallow copy ShoppingListAddLineItemAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static ShoppingListAddLineItemAction deepCopy(@Nullable ShoppingListAddLineItemAction template) factory method to create a deep copy of ShoppingListAddLineItemAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShoppingListAddLineItemAction- Returns:
- builder
-
builder
create builder for ShoppingListAddLineItemAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withShoppingListAddLineItemAction
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
-