Interface CartChangeCustomLineItemQuantityAction
- All Superinterfaces:
CartUpdateAction,ResourceUpdateAction<CartUpdateAction>
When multiple shipping addresses are set for a Custom Line Item, use the Add CustomLineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Custom Line Item quantity should be distributed over the sub-quantities, the shippingDetails field is kept in its current state to avoid data loss.
To change the Custom Line Item quantity and shipping details together, use this update action in combination with the Set CustomLineItem ShippingDetails update action in a single Cart update command.
Example to create an instance using the builder pattern
CartChangeCustomLineItemQuantityAction cartChangeCustomLineItemQuantityAction = CartChangeCustomLineItemQuantityAction.builder()
.quantity(0.3)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for CartChangeCustomLineItemQuantityAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CartChangeCustomLineItemQuantityActioncreate builder for CartChangeCustomLineItemQuantityAction instancecopyDeep()factory method to create a deep copy of CartChangeCustomLineItemQuantityActionidof the CustomLineItem to update.keyof the CustomLineItem to update.@NotNull LongNew value to set.of()factory methodof(CartChangeCustomLineItemQuantityAction template) factory method to create a shallow copy CartChangeCustomLineItemQuantityActionvoidsetCustomLineItemId(String customLineItemId) idof the CustomLineItem to update.voidsetCustomLineItemKey(String customLineItemKey) keyof the CustomLineItem to update.voidsetQuantity(Long quantity) New value to set.static com.fasterxml.jackson.core.type.TypeReference<CartChangeCustomLineItemQuantityAction>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithCartChangeCustomLineItemQuantityAction(Function<CartChangeCustomLineItemQuantityAction, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
getAction, withCartUpdateActionMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
CHANGE_CUSTOM_LINE_ITEM_QUANTITY
discriminator value for CartChangeCustomLineItemQuantityAction- See Also:
-
-
Method Details
-
getCustomLineItemId
String getCustomLineItemId()idof the CustomLineItem to update. EithercustomLineItemIdorcustomLineItemKeyis required.- Returns:
- customLineItemId
-
getCustomLineItemKey
String getCustomLineItemKey()keyof the CustomLineItem to update. EithercustomLineItemIdorcustomLineItemKeyis required.- Returns:
- customLineItemKey
-
getQuantity
New value to set.
If
0, the Custom Line Item is removed from the Cart.- Returns:
- quantity
-
setCustomLineItemId
idof the CustomLineItem to update. EithercustomLineItemIdorcustomLineItemKeyis required.- Parameters:
customLineItemId- value to be set
-
setCustomLineItemKey
keyof the CustomLineItem to update. EithercustomLineItemIdorcustomLineItemKeyis required.- Parameters:
customLineItemKey- value to be set
-
setQuantity
New value to set.
If
0, the Custom Line Item is removed from the Cart.- Parameters:
quantity- value to be set
-
of
factory method- Returns:
- instance of CartChangeCustomLineItemQuantityAction
-
of
factory method to create a shallow copy CartChangeCustomLineItemQuantityAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
CartChangeCustomLineItemQuantityAction copyDeep()- Specified by:
copyDeepin interfaceCartUpdateAction
-
deepCopy
@Nullable static CartChangeCustomLineItemQuantityAction deepCopy(@Nullable CartChangeCustomLineItemQuantityAction template) factory method to create a deep copy of CartChangeCustomLineItemQuantityAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartChangeCustomLineItemQuantityAction- Returns:
- builder
-
builder
static CartChangeCustomLineItemQuantityActionBuilder builder(CartChangeCustomLineItemQuantityAction template) create builder for CartChangeCustomLineItemQuantityAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withCartChangeCustomLineItemQuantityAction
default <T> T withCartChangeCustomLineItemQuantityAction(Function<CartChangeCustomLineItemQuantityAction, T> helper) accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
static com.fasterxml.jackson.core.type.TypeReference<CartChangeCustomLineItemQuantityAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-