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