Class ShippingRateDraftBuilder
java.lang.Object
com.commercetools.api.models.shipping_method.ShippingRateDraftBuilder
- All Implemented Interfaces:
Builder<ShippingRateDraft>
ShippingRateDraftBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ShippingRateDraft shippingRateDraft = ShippingRateDraft.builder()
.price(priceBuilder -> priceBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ShippingRateDraft with checking for non-null required valuesbuilds ShippingRateDraft without checking for non-null required valuesFree shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.freeAbove
(Function<MoneyBuilder, MoneyBuilder> builder) Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.getPrice()
Money value of the ShippingRate.getTiers()
Price tiers for the ShippingRate.static ShippingRateDraftBuilder
of()
factory method for an instance of ShippingRateDraftBuilderstatic ShippingRateDraftBuilder
of
(ShippingRateDraft template) create builder for ShippingRateDraft instanceplusTiers
(ShippingRatePriceTier... tiers) Price tiers for the ShippingRate.plusTiers
(Function<ShippingRatePriceTierBuilder, Builder<? extends ShippingRatePriceTier>> builder) Price tiers for the ShippingRate.Money value of the ShippingRate.price
(Function<MoneyBuilder, MoneyBuilder> builder) Money value of the ShippingRate.tiers
(ShippingRatePriceTier... tiers) Price tiers for the ShippingRate.tiers
(List<ShippingRatePriceTier> tiers) Price tiers for the ShippingRate.withFreeAbove
(Function<MoneyBuilder, Money> builder) Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.withPrice
(Function<MoneyBuilder, Money> builder) Money value of the ShippingRate.withTiers
(Function<ShippingRatePriceTierBuilder, Builder<? extends ShippingRatePriceTier>> builder) Price tiers for the ShippingRate.
-
Constructor Details
-
ShippingRateDraftBuilder
public ShippingRateDraftBuilder()
-
-
Method Details
-
price
Money value of the ShippingRate.
- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
withPrice
Money value of the ShippingRate.
- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
price
Money value of the ShippingRate.
- Parameters:
price
- value to be set- Returns:
- Builder
-
freeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Parameters:
builder
- function to build the freeAbove value- Returns:
- Builder
-
withFreeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Parameters:
builder
- function to build the freeAbove value- Returns:
- Builder
-
freeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Parameters:
freeAbove
- value to be set- Returns:
- Builder
-
tiers
Price tiers for the ShippingRate.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
tiers
Price tiers for the ShippingRate.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
Price tiers for the ShippingRate.
- Parameters:
tiers
- value to be set- Returns:
- Builder
-
plusTiers
public ShippingRateDraftBuilder plusTiers(Function<ShippingRatePriceTierBuilder, Builder<? extends ShippingRatePriceTier>> builder) Price tiers for the ShippingRate.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
withTiers
public ShippingRateDraftBuilder withTiers(Function<ShippingRatePriceTierBuilder, Builder<? extends ShippingRatePriceTier>> builder) Price tiers for the ShippingRate.
- Parameters:
builder
- function to build the tiers value- Returns:
- Builder
-
getPrice
Money value of the ShippingRate.
- Returns:
- price
-
getFreeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Returns:
- freeAbove
-
getTiers
Price tiers for the ShippingRate.
- Returns:
- tiers
-
build
builds ShippingRateDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShippingRateDraft>
- Returns:
- ShippingRateDraft
-
buildUnchecked
builds ShippingRateDraft without checking for non-null required values- Returns:
- ShippingRateDraft
-
of
factory method for an instance of ShippingRateDraftBuilder- Returns:
- builder
-
of
create builder for ShippingRateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-