Class CartDiscountUpdateBuilder
java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountUpdateBuilder
- All Implemented Interfaces:
Builder<CartDiscountUpdate>
CartDiscountUpdateBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartDiscountUpdate cartDiscountUpdate = CartDiscountUpdate.builder()
.version(0.3)
.plusActions(actionsBuilder -> actionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactions
(CartDiscountUpdateAction... actions) Update actions to be performed on the CartDiscount.actions
(List<CartDiscountUpdateAction> actions) Update actions to be performed on the CartDiscount.build()
builds CartDiscountUpdate with checking for non-null required valuesbuilds CartDiscountUpdate without checking for non-null required valuesUpdate actions to be performed on the CartDiscount.Expected version of the CartDiscount on which the changes should be applied.static CartDiscountUpdateBuilder
of()
factory method for an instance of CartDiscountUpdateBuilderstatic CartDiscountUpdateBuilder
of
(CartDiscountUpdate template) create builder for CartDiscountUpdate instanceplusActions
(CartDiscountUpdateAction... actions) Update actions to be performed on the CartDiscount.plusActions
(Function<CartDiscountUpdateActionBuilder, Builder<? extends CartDiscountUpdateAction>> builder) Update actions to be performed on the CartDiscount.Expected version of the CartDiscount on which the changes should be applied.withActions
(Function<CartDiscountUpdateActionBuilder, Builder<? extends CartDiscountUpdateAction>> builder) Update actions to be performed on the CartDiscount.
-
Constructor Details
-
CartDiscountUpdateBuilder
public CartDiscountUpdateBuilder()
-
-
Method Details
-
version
Expected version of the CartDiscount on which the changes should be applied. 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 CartDiscount.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
actions
Update actions to be performed on the CartDiscount.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
Update actions to be performed on the CartDiscount.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
public CartDiscountUpdateBuilder plusActions(Function<CartDiscountUpdateActionBuilder, Builder<? extends CartDiscountUpdateAction>> builder) Update actions to be performed on the CartDiscount.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
withActions
public CartDiscountUpdateBuilder withActions(Function<CartDiscountUpdateActionBuilder, Builder<? extends CartDiscountUpdateAction>> builder) Update actions to be performed on the CartDiscount.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
getVersion
Expected version of the CartDiscount on which the changes should be applied. 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 CartDiscount.
- Returns:
- actions
-
build
builds CartDiscountUpdate with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartDiscountUpdate>
- Returns:
- CartDiscountUpdate
-
buildUnchecked
builds CartDiscountUpdate without checking for non-null required values- Returns:
- CartDiscountUpdate
-
of
factory method for an instance of CartDiscountUpdateBuilder- Returns:
- builder
-
of
create builder for CartDiscountUpdate instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-