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 PriceTierDraftBuilderbuilder()builder factory method for PriceTierDraftstatic PriceTierDraftBuilderbuilder(PriceTierDraft template) create builder for PriceTierDraft instancecopyDeep()static PriceTierDraftdeepCopy(PriceTierDraft template) factory method to create a deep copy of PriceTierDraft@NotNull LongMinimum quantity this Price tier is valid for.@NotNull @Valid MoneygetValue()Money value that applies when theminimumQuantityis greater than or equal to the LineItemquantity.static PriceTierDraftof()factory methodstatic PriceTierDraftof(PriceTierDraft template) factory method to create a shallow copy PriceTierDraftvoidsetMinimumQuantity(Long minimumQuantity) Minimum quantity this Price tier is valid for.voidMoney value that applies when theminimumQuantityis greater than or equal to the LineItemquantity.static com.fasterxml.jackson.core.type.TypeReference<PriceTierDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithPriceTierDraft(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
minimumQuantityis greater than or equal to the LineItemquantity.To set the money value in high precision, use HighPrecisionMoneyDraft.
The
currencyCodeof a Price tier must be the same as thecurrencyCodein thevalueof 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
minimumQuantityis greater than or equal to the LineItemquantity.To set the money value in high precision, use HighPrecisionMoneyDraft.
The
currencyCodeof a Price tier must be the same as thecurrencyCodein thevalueof 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
-
copyDeep
PriceTierDraft copyDeep() -
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
-