Class DiscountCodeInfoBuilder
java.lang.Object
com.commercetools.history.models.common.DiscountCodeInfoBuilder
- All Implemented Interfaces:
Builder<DiscountCodeInfo>
DiscountCodeInfoBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountCodeInfo discountCodeInfo = DiscountCodeInfo.builder()
.discountCode(discountCodeBuilder -> discountCodeBuilder)
.state(DiscountCodeState.NOT_ACTIVE)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountCodeInfo with checking for non-null required valuesbuilds DiscountCodeInfo without checking for non-null required valuesdiscountCode
(Reference discountCode) set the value to the discountCodediscountCode
(Function<ReferenceBuilder, ReferenceBuilder> builder) set the value to the discountCode using the builder functionvalue of discountCode}getState()
value of state}static DiscountCodeInfoBuilder
of()
factory method for an instance of DiscountCodeInfoBuilderstatic DiscountCodeInfoBuilder
of
(DiscountCodeInfo template) create builder for DiscountCodeInfo instancestate
(DiscountCodeState state) set the value to the statewithDiscountCode
(Function<ReferenceBuilder, Reference> builder) set the value to the discountCode using the builder function
-
Constructor Details
-
DiscountCodeInfoBuilder
public DiscountCodeInfoBuilder()
-
-
Method Details
-
discountCode
set the value to the discountCode using the builder function- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
withDiscountCode
set the value to the discountCode using the builder function- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
discountCode
set the value to the discountCode- Parameters:
discountCode
- value to be set- Returns:
- Builder
-
state
set the value to the state- Parameters:
state
- value to be set- Returns:
- Builder
-
getDiscountCode
value of discountCode}- Returns:
- discountCode
-
getState
value of state}- Returns:
- state
-
build
builds DiscountCodeInfo with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountCodeInfo>
- Returns:
- DiscountCodeInfo
-
buildUnchecked
builds DiscountCodeInfo without checking for non-null required values- Returns:
- DiscountCodeInfo
-
of
factory method for an instance of DiscountCodeInfoBuilder- Returns:
- builder
-
of
create builder for DiscountCodeInfo instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-