Class CartChangeLineItemQuantityActionImpl
- All Implemented Interfaces:
CartChangeLineItemQuantityAction
,CartUpdateAction
,ResourceUpdateAction<CartUpdateAction>
,io.vrap.rmf.base.client.ModelBase
When multiple shipping addresses are set for a Line Item, use the Remove LineItem and Add LineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the 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 Line Item quantity and shipping details together, use this update action in combination with the Set LineItemShippingDetails update action in a single Cart update command.
The LineItem price is set as described in LineItem Price selection.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Field Summary
Fields inherited from interface com.commercetools.api.models.cart.CartChangeLineItemQuantityAction
CHANGE_LINE_ITEM_QUANTITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Sets the LineItemprice
to the given value when changing the quantity of a Line Item with theExternalPrice
LineItemPriceMode.Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.id
of the LineItem to update.key
of the LineItem to update.New value to set.int
hashCode()
void
setExternalPrice
(Money externalPrice) Sets the LineItemprice
to the given value when changing the quantity of a Line Item with theExternalPrice
LineItemPriceMode.void
setExternalTotalPrice
(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.void
setLineItemId
(String lineItemId) id
of the LineItem to update.void
setLineItemKey
(String lineItemKey) key
of the LineItem to update.void
setQuantity
(Long quantity) New value to set.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.commercetools.api.models.cart.CartChangeLineItemQuantityAction
withCartChangeLineItemQuantityAction
Methods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
withCartUpdateAction
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Constructor Details
-
CartChangeLineItemQuantityActionImpl
public CartChangeLineItemQuantityActionImpl()create empty instance
-
-
Method Details
-
getAction
- Specified by:
getAction
in interfaceCartUpdateAction
- Specified by:
getAction
in interfaceResourceUpdateAction<CartUpdateAction>
- Returns:
- action
-
getLineItemId
id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Specified by:
getLineItemId
in interfaceCartChangeLineItemQuantityAction
- Returns:
- lineItemId
-
getLineItemKey
key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Specified by:
getLineItemKey
in interfaceCartChangeLineItemQuantityAction
- Returns:
- lineItemKey
-
getQuantity
New value to set.
If
0
, the Line Item is removed from the Cart.- Specified by:
getQuantity
in interfaceCartChangeLineItemQuantityAction
- Returns:
- quantity
-
getExternalPrice
Sets the LineItem
price
to the given value when changing the quantity of a Line Item with theExternalPrice
LineItemPriceMode.The LineItem price is updated as described in LineItem Price selection.
- Specified by:
getExternalPrice
in interfaceCartChangeLineItemQuantityAction
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.- Specified by:
getExternalTotalPrice
in interfaceCartChangeLineItemQuantityAction
- Returns:
- externalTotalPrice
-
setLineItemId
Description copied from interface:CartChangeLineItemQuantityAction
id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Specified by:
setLineItemId
in interfaceCartChangeLineItemQuantityAction
- Parameters:
lineItemId
- value to be set
-
setLineItemKey
Description copied from interface:CartChangeLineItemQuantityAction
key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Specified by:
setLineItemKey
in interfaceCartChangeLineItemQuantityAction
- Parameters:
lineItemKey
- value to be set
-
setQuantity
Description copied from interface:CartChangeLineItemQuantityAction
New value to set.
If
0
, the Line Item is removed from the Cart.- Specified by:
setQuantity
in interfaceCartChangeLineItemQuantityAction
- Parameters:
quantity
- value to be set
-
setExternalPrice
Description copied from interface:CartChangeLineItemQuantityAction
Sets the LineItem
price
to the given value when changing the quantity of a Line Item with theExternalPrice
LineItemPriceMode.The LineItem price is updated as described in LineItem Price selection.
- Specified by:
setExternalPrice
in interfaceCartChangeLineItemQuantityAction
- Parameters:
externalPrice
- value to be set
-
setExternalTotalPrice
Description copied from interface:CartChangeLineItemQuantityAction
Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.- Specified by:
setExternalTotalPrice
in interfaceCartChangeLineItemQuantityAction
- Parameters:
externalTotalPrice
- value to be set
-
equals
-
hashCode
-