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
Constructors -
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 usesExternalPriceLineItemPriceMode.externalPrice(Function<MoneyBuilder, MoneyBuilder> builder) Required when the Line Item usesExternalPriceLineItemPriceMode.externalTotalPrice(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.externalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.Required when the Line Item usesExternalPriceLineItemPriceMode.Sets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.idof the LineItem to update.keyof the LineItem to update.New value to set.lineItemId(String lineItemId) idof the LineItem to update.lineItemKey(String lineItemKey) keyof 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 usesExternalPriceLineItemPriceMode.withExternalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItempriceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode.
-
Constructor Details
-
CartChangeLineItemQuantityActionBuilder
public CartChangeLineItemQuantityActionBuilder()
-
-
Method Details
-
lineItemId
idof the LineItem to update. EitherlineItemIdorlineItemKeyis required.- Parameters:
lineItemId- value to be set- Returns:
- Builder
-
lineItemKey
keyof the LineItem to update. EitherlineItemIdorlineItemKeyis 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
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
builder- function to build the externalPrice value- Returns:
- Builder
-
withExternalPrice
public CartChangeLineItemQuantityActionBuilder withExternalPrice(Function<MoneyBuilder, Money> builder) Required when the Line Item uses
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
builder- function to build the externalPrice value- Returns:
- Builder
-
externalPrice
Required when the Line Item uses
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
externalPrice- value to be set- Returns:
- Builder
-
externalTotalPrice
public CartChangeLineItemQuantityActionBuilder externalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPriceBuilder> builder) Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis set toPlatform.- Parameters:
builder- function to build the externalTotalPrice value- Returns:
- Builder
-
withExternalTotalPrice
public CartChangeLineItemQuantityActionBuilder withExternalTotalPrice(Function<ExternalLineItemTotalPriceBuilder, ExternalLineItemTotalPrice> builder) Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis set toPlatform.- Parameters:
builder- function to build the externalTotalPrice value- Returns:
- Builder
-
externalTotalPrice
public CartChangeLineItemQuantityActionBuilder externalTotalPrice(@Nullable ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis set toPlatform.- Parameters:
externalTotalPrice- value to be set- Returns:
- Builder
-
getLineItemId
idof the LineItem to update. EitherlineItemIdorlineItemKeyis required.- Returns:
- lineItemId
-
getLineItemKey
keyof the LineItem to update. EitherlineItemIdorlineItemKeyis 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
ExternalPriceLineItemPriceMode. Sets the LineItempriceto the given value when changing the quantity of a Line Item.The LineItem price is updated as described in Line Item price selection.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
priceandtotalPriceto the given value when changing the quantity of a Line Item with theExternalTotalLineItemPriceMode. IfexternalTotalPriceis not given and thepriceModeisExternalTotal, the external price is unset and thepriceModeis set toPlatform.- Returns:
- externalTotalPrice
-
build
builds CartChangeLineItemQuantityAction with checking for non-null required values- Specified by:
buildin 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
-