Class ItemStateBuilder
java.lang.Object
com.commercetools.importapi.models.orders.ItemStateBuilder
ItemStateBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ItemState itemState = ItemState.builder()
.quantity(0.3)
.state(stateBuilder -> stateBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ItemState with checking for non-null required valuesbuilds ItemState without checking for non-null required valuesvalue of quantity}getState()
Maps toItemState.state
.static ItemStateBuilder
of()
factory method for an instance of ItemStateBuilderstatic ItemStateBuilder
create builder for ItemState instanceset the value to the quantitystate
(StateKeyReference state) Maps toItemState.state
.Maps toItemState.state
.Maps toItemState.state
.
-
Constructor Details
-
ItemStateBuilder
public ItemStateBuilder()
-
-
Method Details
-
quantity
set the value to the quantity- Parameters:
quantity
- value to be set- Returns:
- Builder
-
state
Maps to
ItemState.state
.- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
Maps to
ItemState.state
.- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
state
Maps to
ItemState.state
.- Parameters:
state
- value to be set- Returns:
- Builder
-
getQuantity
value of quantity}- Returns:
- quantity
-
getState
Maps to
ItemState.state
.- Returns:
- state
-
build
builds ItemState with checking for non-null required values -
buildUnchecked
builds ItemState without checking for non-null required values- Returns:
- ItemState
-
of
factory method for an instance of ItemStateBuilder- Returns:
- builder
-
of
create builder for ItemState instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-