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 PriceTierBuilder
builder()
builder factory method for PriceTierstatic PriceTierBuilder
create builder for PriceTier instancestatic PriceTier
factory method to create a deep copy of PriceTier@NotNull Long
The minimum quantity this price tier is valid for.@NotNull @Valid TypedMoney
getValue()
The currency of a price tier is always the same as the currency of the base Price.static PriceTier
of()
factory methodstatic PriceTier
factory method to create a shallow copy PriceTiervoid
setMinimumQuantity
(Long minimumQuantity) The minimum quantity this price tier is valid for.void
setValue
(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> T
withPriceTier
(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
-
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
-