Interface PriceTierDraft
- All Superinterfaces:
Draft<PriceTierDraft>
Specifies a Price tier that applies when the minimum quantity for the LineItem of a ProductVariant with the related Price is reached in a Cart.
Example to create an instance using the builder pattern
PriceTierDraft priceTierDraft = PriceTierDraft.builder()
.minimumQuantity(0.3)
.value(valueBuilder -> valueBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic PriceTierDraftBuilder
builder()
builder factory method for PriceTierDraftstatic PriceTierDraftBuilder
builder
(PriceTierDraft template) create builder for PriceTierDraft instancestatic PriceTierDraft
deepCopy
(PriceTierDraft template) factory method to create a deep copy of PriceTierDraft@NotNull Long
Minimum quantity this Price tier is valid for.@NotNull @Valid Money
getValue()
Money value that applies when theminimumQuantity
is greater than or equal to the LineItemquantity
.static PriceTierDraft
of()
factory methodstatic PriceTierDraft
of
(PriceTierDraft template) factory method to create a shallow copy PriceTierDraftvoid
setMinimumQuantity
(Long minimumQuantity) Minimum quantity this Price tier is valid for.void
Money value that applies when theminimumQuantity
is greater than or equal to the LineItemquantity
.static com.fasterxml.jackson.core.type.TypeReference<PriceTierDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withPriceTierDraft
(Function<PriceTierDraft, T> helper) accessor map function
-
Method Details
-
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
. In the case one of the constraint is not met an InvalidField is returned.- Returns:
- minimumQuantity
-
getValue
Money value that applies when the
minimumQuantity
is greater than or equal to the LineItemquantity
.The
currencyCode
of a Price tier must be the same as thecurrencyCode
in thevalue
of the related Price.- Returns:
- value
-
setMinimumQuantity
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
. In the case one of the constraint is not met an InvalidField is returned.- Parameters:
minimumQuantity
- value to be set
-
setValue
Money value that applies when the
minimumQuantity
is greater than or equal to the LineItemquantity
.The
currencyCode
of a Price tier must be the same as thecurrencyCode
in thevalue
of the related Price.- Parameters:
value
- value to be set
-
of
factory method- Returns:
- instance of PriceTierDraft
-
of
factory method to create a shallow copy PriceTierDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of PriceTierDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for PriceTierDraft- Returns:
- builder
-
builder
create builder for PriceTierDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withPriceTierDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-