Class PriceTierBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<PriceTier>
Example to create an instance using the builder pattern
PriceTier priceTier = PriceTier.builder()
.minimumQuantity(0.3)
.value(valueBuilder -> valueBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds PriceTier with checking for non-null required valuesbuilds PriceTier without checking for non-null required valuesMinimum quantity this Price tier is valid for.getValue()
Money value that applies when theminimumQuantity
is greater than or equal to the LineItemquantity
.minimumQuantity
(Long minimumQuantity) Minimum quantity this Price tier is valid for.static PriceTierBuilder
of()
factory method for an instance of PriceTierBuilderstatic PriceTierBuilder
create builder for PriceTier instancevalue
(TypedMoney value) Money value that applies when theminimumQuantity
is greater than or equal to the LineItemquantity
.value
(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Money value that applies when theminimumQuantity
is greater than or equal to the LineItemquantity
.
-
Constructor Details
-
PriceTierBuilder
public PriceTierBuilder()
-
-
Method Details
-
minimumQuantity
Minimum quantity this Price tier is valid for.
The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1. A Price or StandalonePrice cannot contain more than one tier with the same
minimumQuantity
.- Parameters:
minimumQuantity
- value to be set- Returns:
- Builder
-
value
Money value that applies when the
minimumQuantity
is greater than or equal to the LineItemquantity
.The
currencyCode
of a Price tier is always the same as thecurrencyCode
in thevalue
of the related Price.- Parameters:
value
- value to be set- Returns:
- Builder
-
value
public PriceTierBuilder value(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Money value that applies when the
minimumQuantity
is greater than or equal to the LineItemquantity
.The
currencyCode
of a Price tier is always the same as thecurrencyCode
in thevalue
of the related Price.- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
getMinimumQuantity
Minimum quantity this Price tier is valid for.
The minimum quantity is always greater than or equal to 2. The base Price is interpreted as valid for a minimum quantity equal to 1. A Price or StandalonePrice cannot contain more than one tier with the same
minimumQuantity
.- Returns:
- minimumQuantity
-
getValue
Money value that applies when the
minimumQuantity
is greater than or equal to the LineItemquantity
.The
currencyCode
of a Price tier is always the same as thecurrencyCode
in thevalue
of the related Price.- Returns:
- value
-
build
builds PriceTier with checking for non-null required values- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<PriceTier>
- Returns:
- PriceTier
-
buildUnchecked
builds PriceTier without checking for non-null required values- Returns:
- PriceTier
-
of
factory method for an instance of PriceTierBuilder- Returns:
- builder
-
of
create builder for PriceTier instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-