Class CartUpdateBuilder
java.lang.Object
com.commercetools.api.models.cart.CartUpdateBuilder
- All Implemented Interfaces:
Builder<CartUpdate>
CartUpdateBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartUpdate cartUpdate = CartUpdate.builder()
.version(0.3)
.plusActions(actionsBuilder -> actionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactions
(CartUpdateAction... actions) Update actions to be performed on the Cart.actions
(List<CartUpdateAction> actions) Update actions to be performed on the Cart.build()
builds CartUpdate with checking for non-null required valuesbuilds CartUpdate without checking for non-null required valuesUpdate actions to be performed on the Cart.Expected version of the Cart on which the changes apply.static CartUpdateBuilder
of()
factory method for an instance of CartUpdateBuilderstatic CartUpdateBuilder
of
(CartUpdate template) create builder for CartUpdate instanceplusActions
(CartUpdateAction... actions) Update actions to be performed on the Cart.plusActions
(Function<CartUpdateActionBuilder, Builder<? extends CartUpdateAction>> builder) Update actions to be performed on the Cart.Expected version of the Cart on which the changes apply.withActions
(Function<CartUpdateActionBuilder, Builder<? extends CartUpdateAction>> builder) Update actions to be performed on the Cart.
-
Constructor Details
-
CartUpdateBuilder
public CartUpdateBuilder()
-
-
Method Details
-
version
Expected version of the Cart on which the changes apply. If the expected version does not match the actual version, a ConcurrentModification error will be returned.
- Parameters:
version
- value to be set- Returns:
- Builder
-
actions
Update actions to be performed on the Cart.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
actions
Update actions to be performed on the Cart.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
Update actions to be performed on the Cart.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
public CartUpdateBuilder plusActions(Function<CartUpdateActionBuilder, Builder<? extends CartUpdateAction>> builder) Update actions to be performed on the Cart.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
withActions
public CartUpdateBuilder withActions(Function<CartUpdateActionBuilder, Builder<? extends CartUpdateAction>> builder) Update actions to be performed on the Cart.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
getVersion
Expected version of the Cart on which the changes apply. If the expected version does not match the actual version, a ConcurrentModification error will be returned.
- Returns:
- version
-
getActions
Update actions to be performed on the Cart.
- Returns:
- actions
-
build
builds CartUpdate with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartUpdate>
- Returns:
- CartUpdate
-
buildUnchecked
builds CartUpdate without checking for non-null required values- Returns:
- CartUpdate
-
of
factory method for an instance of CartUpdateBuilder- Returns:
- builder
-
of
create builder for CartUpdate instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-