Class DiscountCodeInfoBuilder
java.lang.Object
com.commercetools.api.models.cart.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
(DiscountCodeReference discountCode) Discount Code associated with the Cart or Order.Discount Code associated with the Cart or Order.Discount Code associated with the Cart or Order.getState()
Indicates the state of the Discount Code applied to the Cart or Order.static DiscountCodeInfoBuilder
of()
factory method for an instance of DiscountCodeInfoBuilderstatic DiscountCodeInfoBuilder
of
(DiscountCodeInfo template) create builder for DiscountCodeInfo instancestate
(DiscountCodeState state) Indicates the state of the Discount Code applied to the Cart or Order.Discount Code associated with the Cart or Order.
-
Constructor Details
-
DiscountCodeInfoBuilder
public DiscountCodeInfoBuilder()
-
-
Method Details
-
discountCode
public DiscountCodeInfoBuilder discountCode(Function<DiscountCodeReferenceBuilder, DiscountCodeReferenceBuilder> builder) Discount Code associated with the Cart or Order.
- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
withDiscountCode
public DiscountCodeInfoBuilder withDiscountCode(Function<DiscountCodeReferenceBuilder, DiscountCodeReference> builder) Discount Code associated with the Cart or Order.
- Parameters:
builder
- function to build the discountCode value- Returns:
- Builder
-
discountCode
Discount Code associated with the Cart or Order.
- Parameters:
discountCode
- value to be set- Returns:
- Builder
-
state
Indicates the state of the Discount Code applied to the Cart or Order.
- Parameters:
state
- value to be set- Returns:
- Builder
-
getDiscountCode
Discount Code associated with the Cart or Order.
- Returns:
- discountCode
-
getState
Indicates the state of the Discount Code applied to the Cart or Order.
- 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
-