Class DiscountedPriceDraftBuilder
java.lang.Object
com.commercetools.api.models.common.DiscountedPriceDraftBuilder
- All Implemented Interfaces:
Builder<DiscountedPriceDraft>
DiscountedPriceDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
DiscountedPriceDraft discountedPriceDraft = DiscountedPriceDraft.builder()
.value(valueBuilder -> valueBuilder)
.discount(discountBuilder -> discountBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountedPriceDraft with checking for non-null required valuesbuilds DiscountedPriceDraft without checking for non-null required valuesdiscount
(ProductDiscountReference discount) Relates the referenced ProductDiscount to the discounted price.Relates the referenced ProductDiscount to the discounted price.Relates the referenced ProductDiscount to the discounted price.getValue()
Sets the money value for the discounted price.static DiscountedPriceDraftBuilder
of()
factory method for an instance of DiscountedPriceDraftBuilderstatic DiscountedPriceDraftBuilder
of
(DiscountedPriceDraft template) create builder for DiscountedPriceDraft instanceSets the money value for the discounted price.value
(Function<MoneyBuilder, MoneyBuilder> builder) Sets the money value for the discounted price.Relates the referenced ProductDiscount to the discounted price.withValue
(Function<MoneyBuilder, Money> builder) Sets the money value for the discounted price.
-
Constructor Details
-
DiscountedPriceDraftBuilder
public DiscountedPriceDraftBuilder()
-
-
Method Details
-
value
Sets the money value for the discounted price.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
withValue
Sets the money value for the discounted price.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
value
Sets the money value for the discounted price.
- Parameters:
value
- value to be set- Returns:
- Builder
-
discount
public DiscountedPriceDraftBuilder discount(Function<ProductDiscountReferenceBuilder, ProductDiscountReferenceBuilder> builder) Relates the referenced ProductDiscount to the discounted price.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
withDiscount
public DiscountedPriceDraftBuilder withDiscount(Function<ProductDiscountReferenceBuilder, ProductDiscountReference> builder) Relates the referenced ProductDiscount to the discounted price.
- Parameters:
builder
- function to build the discount value- Returns:
- Builder
-
discount
Relates the referenced ProductDiscount to the discounted price.
- Parameters:
discount
- value to be set- Returns:
- Builder
-
getValue
Sets the money value for the discounted price.
- Returns:
- value
-
getDiscount
Relates the referenced ProductDiscount to the discounted price.
- Returns:
- discount
-
build
builds DiscountedPriceDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountedPriceDraft>
- Returns:
- DiscountedPriceDraft
-
buildUnchecked
builds DiscountedPriceDraft without checking for non-null required values- Returns:
- DiscountedPriceDraft
-
of
factory method for an instance of DiscountedPriceDraftBuilder- Returns:
- builder
-
of
create builder for DiscountedPriceDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-