Class StateUpdateBuilder
java.lang.Object
com.commercetools.api.models.state.StateUpdateBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<StateUpdate>
public class StateUpdateBuilder
extends Object
implements io.vrap.rmf.base.client.Builder<StateUpdate>
StateUpdateBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
StateUpdate stateUpdate = StateUpdate.builder()
.version(0.3)
.plusActions(actionsBuilder -> actionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionactions
(StateUpdateAction... actions) Update actions to be performed on the State.actions
(List<StateUpdateAction> actions) Update actions to be performed on the State.build()
builds StateUpdate with checking for non-null required valuesbuilds StateUpdate without checking for non-null required valuesUpdate actions to be performed on the State.Expected version of the State on which the changes should be applied.static StateUpdateBuilder
of()
factory method for an instance of StateUpdateBuilderstatic StateUpdateBuilder
of
(StateUpdate template) create builder for StateUpdate instanceplusActions
(StateUpdateAction... actions) Update actions to be performed on the State.plusActions
(Function<StateUpdateActionBuilder, io.vrap.rmf.base.client.Builder<? extends StateUpdateAction>> builder) Update actions to be performed on the State.Expected version of the State on which the changes should be applied.withActions
(Function<StateUpdateActionBuilder, io.vrap.rmf.base.client.Builder<? extends StateUpdateAction>> builder) Update actions to be performed on the State.
-
Constructor Details
-
StateUpdateBuilder
public StateUpdateBuilder()
-
-
Method Details
-
version
Expected version of the State on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error is returned.
- Parameters:
version
- value to be set- Returns:
- Builder
-
actions
Update actions to be performed on the State.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
actions
Update actions to be performed on the State.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
Update actions to be performed on the State.
- Parameters:
actions
- value to be set- Returns:
- Builder
-
plusActions
public StateUpdateBuilder plusActions(Function<StateUpdateActionBuilder, io.vrap.rmf.base.client.Builder<? extends StateUpdateAction>> builder) Update actions to be performed on the State.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
withActions
public StateUpdateBuilder withActions(Function<StateUpdateActionBuilder, io.vrap.rmf.base.client.Builder<? extends StateUpdateAction>> builder) Update actions to be performed on the State.
- Parameters:
builder
- function to build the actions value- Returns:
- Builder
-
getVersion
Expected version of the State on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error is returned.
- Returns:
- version
-
getActions
Update actions to be performed on the State.
- Returns:
- actions
-
build
builds StateUpdate with checking for non-null required values- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<StateUpdate>
- Returns:
- StateUpdate
-
buildUnchecked
builds StateUpdate without checking for non-null required values- Returns:
- StateUpdate
-
of
factory method for an instance of StateUpdateBuilder- Returns:
- builder
-
of
create builder for StateUpdate instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-