Class CartChangeLineItemQuantityActionBuilder
- All Implemented Interfaces:
Builder<CartChangeLineItemQuantityAction>
Example to create an instance using the builder pattern
CartChangeLineItemQuantityAction cartChangeLineItemQuantityAction = CartChangeLineItemQuantityAction.builder()
.quantity(0.3)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CartChangeLineItemQuantityAction with checking for non-null required valuesbuilds CartChangeLineItemQuantityAction without checking for non-null required valuesexternalPrice
(Money externalPrice) Required when the Line Item usesExternalPrice
LineItemPriceMode.externalPrice
(Function<MoneyBuilder, MoneyBuilder> builder) Required when the Line Item usesExternalPrice
LineItemPriceMode.externalTotalPrice
(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.externalTotalPrice
(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.Required when the Line Item usesExternalPrice
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.lineItemId
(String lineItemId) id
of the LineItem to update.lineItemKey
(String lineItemKey) key
of the LineItem to update.of()
factory method for an instance of CartChangeLineItemQuantityActionBuilderof
(CartChangeLineItemQuantityAction template) create builder for CartChangeLineItemQuantityAction instanceNew value to set.withExternalPrice
(Function<MoneyBuilder, Money> builder) Required when the Line Item usesExternalPrice
LineItemPriceMode.withExternalTotalPrice
(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItemprice
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode.
-
Constructor Details
-
CartChangeLineItemQuantityActionBuilder
public CartChangeLineItemQuantityActionBuilder()
-
-
Method Details
-
lineItemId
id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Parameters:
lineItemId
- value to be set- Returns:
- Builder
-
lineItemKey
key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Parameters:
lineItemKey
- value to be set- Returns:
- Builder
-
quantity
New value to set.
If
0
, the Line Item is removed from the Cart.- Parameters:
quantity
- value to be set- Returns:
- Builder
-
externalPrice
public CartChangeLineItemQuantityActionBuilder externalPrice(Function<MoneyBuilder, MoneyBuilder> builder) Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Parameters:
builder
- function to build the externalPrice value- Returns:
- Builder
-
withExternalPrice
public CartChangeLineItemQuantityActionBuilder withExternalPrice(Function<MoneyBuilder, Money> builder) Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Parameters:
builder
- function to build the externalPrice value- Returns:
- Builder
-
externalPrice
Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Parameters:
externalPrice
- value to be set- Returns:
- Builder
-
externalTotalPrice
public CartChangeLineItemQuantityActionBuilder externalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Parameters:
builder
- function to build the externalTotalPrice value- Returns:
- Builder
-
withExternalTotalPrice
public CartChangeLineItemQuantityActionBuilder withExternalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Parameters:
builder
- function to build the externalTotalPrice value- Returns:
- Builder
-
externalTotalPrice
public CartChangeLineItemQuantityActionBuilder externalTotalPrice(@Nullable ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Parameters:
externalTotalPrice
- value to be set- Returns:
- Builder
-
getLineItemId
id
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Returns:
- lineItemId
-
getLineItemKey
key
of the LineItem to update. EitherlineItemId
orlineItemKey
is required.- Returns:
- lineItemKey
-
getQuantity
New value to set.
If
0
, the Line Item is removed from the Cart.- Returns:
- quantity
-
getExternalPrice
Required when the Line Item uses
ExternalPrice
LineItemPriceMode. Sets the LineItemprice
to the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
price
andtotalPrice
to the given value when changing the quantity of a Line Item with theExternalTotal
LineItemPriceMode. IfexternalTotalPrice
is not given and thepriceMode
isExternalTotal
, the external price is unset and thepriceMode
is set toPlatform
.- Returns:
- externalTotalPrice
-
build
builds CartChangeLineItemQuantityAction with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartChangeLineItemQuantityAction>
- Returns:
- CartChangeLineItemQuantityAction
-
buildUnchecked
builds CartChangeLineItemQuantityAction without checking for non-null required values- Returns:
- CartChangeLineItemQuantityAction
-
of
factory method for an instance of CartChangeLineItemQuantityActionBuilder- Returns:
- builder
-
of
create builder for CartChangeLineItemQuantityAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-