Class PriceBuilder
java.lang.Object
com.commercetools.history.models.common.PriceBuilder
PriceBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
Price price = Price.builder()
.id("{id}")
.value(valueBuilder -> valueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Price with checking for non-null required valuesbuilds Price without checking for non-null required valuesgetId()
value of id}getValue()
value of value}set the value to the idstatic PriceBuilder
of()
factory method for an instance of PriceBuilderstatic PriceBuilder
create builder for Price instanceset the value to the valuevalue
(Function<MoneyBuilder, MoneyBuilder> builder) set the value to the value using the builder functionwithValue
(Function<MoneyBuilder, Money> builder) set the value to the value using the builder function
-
Constructor Details
-
PriceBuilder
public PriceBuilder()
-
-
Method Details
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
value
set the value to the value using the builder function- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
withValue
set the value to the value using the builder function- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
value
set the value to the value- Parameters:
value
- value to be set- Returns:
- Builder
-
getId
value of id}- Returns:
- id
-
getValue
value of value}- Returns:
- value
-
build
builds Price with checking for non-null required values -
buildUnchecked
builds Price without checking for non-null required values- Returns:
- Price
-
of
factory method for an instance of PriceBuilder- Returns:
- builder
-
of
create builder for Price instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-