Interface CartScoreTier
- All Superinterfaces:
ShippingRatePriceTier
The ShippingRate maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges). Either price
or priceFunction
is required.
Example to create an instance using the builder pattern
CartScoreTier cartScoreTier = CartScoreTier.builder()
.score(0.3)
.build()
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CartScoreTierBuilder
builder()
builder factory method for CartScoreTierstatic CartScoreTierBuilder
builder
(CartScoreTier template) create builder for CartScoreTier instancestatic CartScoreTier
deepCopy
(CartScoreTier template) factory method to create a deep copy of CartScoreTierAppears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.@Valid Money
getPrice()
Defines a fixed price for thescore
.@Valid PriceFunction
Dynamically calculates a Price for a range of scores.@NotNull Integer
getScore()
Abstract value for categorizing a Cart.static CartScoreTier
of()
factory methodstatic CartScoreTier
of
(CartScoreTier template) factory method to create a shallow copy CartScoreTiervoid
setIsMatching
(Boolean isMatching) Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.void
Defines a fixed price for thescore
.void
setPriceFunction
(PriceFunction priceFunction) Dynamically calculates a Price for a range of scores.void
Abstract value for categorizing a Cart.static com.fasterxml.jackson.core.type.TypeReference<CartScoreTier>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCartScoreTier
(Function<CartScoreTier, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.shipping_method.ShippingRatePriceTier
getType, withShippingRatePriceTier
-
Field Details
-
CART_SCORE
discriminator value for CartScoreTier- See Also:
-
-
Method Details
-
getScore
Abstract value for categorizing a Cart. The range starts at
0
. The default price covers0
, tiers start at1
. See Tiered shipping rates for details and examples.- Returns:
- score
-
getPrice
Defines a fixed price for the
score
.- Returns:
- price
-
getPriceFunction
Dynamically calculates a Price for a range of scores.
- Returns:
- priceFunction
-
getIsMatching
Boolean getIsMatching()Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.
- Returns:
- isMatching
-
setScore
Abstract value for categorizing a Cart. The range starts at
0
. The default price covers0
, tiers start at1
. See Tiered shipping rates for details and examples.- Parameters:
score
- value to be set
-
setPrice
Defines a fixed price for the
score
.- Parameters:
price
- value to be set
-
setPriceFunction
Dynamically calculates a Price for a range of scores.
- Parameters:
priceFunction
- value to be set
-
setIsMatching
Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.
- Parameters:
isMatching
- value to be set
-
of
factory method- Returns:
- instance of CartScoreTier
-
of
factory method to create a shallow copy CartScoreTier- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CartScoreTier- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartScoreTier- Returns:
- builder
-
builder
create builder for CartScoreTier instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCartScoreTier
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
-