Interface ShippingRate
public interface ShippingRate
ShippingRate
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ShippingRate shippingRate = ShippingRate.builder()
.price(priceBuilder -> priceBuilder)
.plusTiers(tiersBuilder -> tiersBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShippingRateBuilder
builder()
builder factory method for ShippingRatestatic ShippingRateBuilder
builder
(ShippingRate template) create builder for ShippingRate instancestatic ShippingRate
deepCopy
(ShippingRate template) factory method to create a deep copy of ShippingRate@Valid CentPrecisionMoney
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.true
if the ShippingRate matches given Cart or Location.@NotNull @Valid CentPrecisionMoney
getPrice()
Currency amount of the ShippingRate.@NotNull @Valid List<ShippingRatePriceTier>
getTiers()
Price tiers for the ShippingRate.static ShippingRate
of()
factory methodstatic ShippingRate
of
(ShippingRate template) factory method to create a shallow copy ShippingRatevoid
setFreeAbove
(CentPrecisionMoney freeAbove) Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.void
setIsMatching
(Boolean isMatching) true
if the ShippingRate matches given Cart or Location.void
setPrice
(CentPrecisionMoney price) Currency amount of the ShippingRate.void
setTiers
(ShippingRatePriceTier... tiers) Price tiers for the ShippingRate.void
setTiers
(List<ShippingRatePriceTier> tiers) Price tiers for the ShippingRate.static com.fasterxml.jackson.core.type.TypeReference<ShippingRate>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withShippingRate
(Function<ShippingRate, T> helper) accessor map function
-
Method Details
-
getPrice
Currency amount of the ShippingRate.
- Returns:
- price
-
getFreeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Returns:
- freeAbove
-
getIsMatching
Boolean getIsMatching()true
if the ShippingRate matches given Cart or Location. Only appears in response to requests for Get ShippingMethods for a Cart or Get ShippingMethods for a Location.- Returns:
- isMatching
-
getTiers
Price tiers for the ShippingRate.
- Returns:
- tiers
-
setPrice
Currency amount of the ShippingRate.
- Parameters:
price
- value to be set
-
setFreeAbove
Free shipping is applied if the sum of the (Custom) Line Item Prices reaches the specified value.
- Parameters:
freeAbove
- value to be set
-
setIsMatching
true
if the ShippingRate matches given Cart or Location. Only appears in response to requests for Get ShippingMethods for a Cart or Get ShippingMethods for a Location.- Parameters:
isMatching
- value to be set
-
setTiers
Price tiers for the ShippingRate.
- Parameters:
tiers
- values to be set
-
setTiers
Price tiers for the ShippingRate.
- Parameters:
tiers
- values to be set
-
of
factory method- Returns:
- instance of ShippingRate
-
of
factory method to create a shallow copy ShippingRate- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ShippingRate- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShippingRate- Returns:
- builder
-
builder
create builder for ShippingRate instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withShippingRate
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
-