Class DiscountCodeInfoBuilder
java.lang.Object
com.commercetools.importapi.models.orders.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)
.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
(DiscountCodeKeyReference discountCode) References a discount code by key.References a discount code by key.References a discount code by key.getState()
Maps toDiscountCodeInfo.state
static DiscountCodeInfoBuilder
of()
factory method for an instance of DiscountCodeInfoBuilderstatic DiscountCodeInfoBuilder
of
(DiscountCodeInfo template) create builder for DiscountCodeInfo instancestate
(DiscountCodeState state) Maps toDiscountCodeInfo.state
References a discount code by key.
-
Constructor Details
-
DiscountCodeInfoBuilder
public DiscountCodeInfoBuilder()
-
-
Method Details
-
discountCode
public DiscountCodeInfoBuilder discountCode(Function<DiscountCodeKeyReferenceBuilder, DiscountCodeKeyReferenceBuilder> builder) References a discount code by key.
- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
withDiscountCode
public DiscountCodeInfoBuilder withDiscountCode(Function<DiscountCodeKeyReferenceBuilder, DiscountCodeKeyReference> builder) References a discount code by key.
- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
discountCode
References a discount code by key.
- Parameters:
discountCode
- value to be set- Returns:
- Builder
-
state
Maps to
DiscountCodeInfo.state
- Parameters:
state
- value to be set- Returns:
- Builder
-
getDiscountCode
References a discount code by key.
- Returns:
- discountCode
-
getState
Maps to
DiscountCodeInfo.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
-