Interface PriceTier
public interface PriceTier
A price tier is selected instead of the default price when a certain quantity of the ProductVariant is added to a cart and ordered.
Example to create an instance using the builder pattern
PriceTier priceTier = PriceTier.builder()
.minimumQuantity(0.3)
.value(valueBuilder -> valueBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic PriceTierBuilderbuilder()builder factory method for PriceTierstatic PriceTierBuildercreate builder for PriceTier instancecopyDeep()static PriceTierfactory method to create a deep copy of PriceTier@NotNull LongThe minimum quantity this price tier is valid for.@NotNull @Valid TypedMoneygetValue()The currency of a price tier is always the same as the currency of the base Price.static PriceTierof()factory methodstatic PriceTierfactory method to create a shallow copy PriceTiervoidsetMinimumQuantity(Long minimumQuantity) The minimum quantity this price tier is valid for.voidsetValue(TypedMoney value) The currency of a price tier is always the same as the currency of the base Price.static com.fasterxml.jackson.core.type.TypeReference<PriceTier>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithPriceTier(Function<PriceTier, T> helper) accessor map function
-
Method Details
-
getMinimumQuantity
The minimum quantity this price tier is valid for.
- Returns:
- minimumQuantity
-
getValue
The currency of a price tier is always the same as the currency of the base Price.
- Returns:
- value
-
setMinimumQuantity
The minimum quantity this price tier is valid for.
- Parameters:
minimumQuantity- value to be set
-
setValue
The currency of a price tier is always the same as the currency of the base Price.
- Parameters:
value- value to be set
-
of
factory method- Returns:
- instance of PriceTier
-
of
factory method to create a shallow copy PriceTier- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
PriceTier copyDeep() -
deepCopy
factory method to create a deep copy of PriceTier- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for PriceTier- Returns:
- builder
-
builder
create builder for PriceTier instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withPriceTier
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
-