Class ShippingInfoBuilder
- All Implemented Interfaces:
Builder<ShippingInfo>
Example to create an instance using the builder pattern
ShippingInfo shippingInfo = ShippingInfo.builder()
.shippingMethodName("{shippingMethodName}")
.price(priceBuilder -> priceBuilder)
.shippingRate(shippingRateBuilder -> shippingRateBuilder)
.shippingMethodState(ShippingMethodState.DOES_NOT_MATCH_CART)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDeliveries
(Function<DeliveryBuilder, Delivery> builder) Information on how items are delivered to customers.build()
builds ShippingInfo with checking for non-null required valuesbuilds ShippingInfo without checking for non-null required valuesdeliveries
(Delivery... deliveries) Information on how items are delivered to customers.deliveries
(List<Delivery> deliveries) Information on how items are delivered to customers.discountedPrice
(DiscountedLineItemPrice discountedPrice) Discounted price of the Shipping Method.Discounted price of the Shipping Method.Information on how items are delivered to customers.Discounted price of the Shipping Method.getPrice()
Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or theshippingRateInput
field.Not set if a custom Shipping Method is used.Name of the Shipping Method.Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.Used to determine the price.Used to select a Tax Rate when a Cart has thePlatform
TaxMode.Automatically set after thetaxRate
is set.Automatically set in thePlatform
TaxMode after the shipping address is set.static ShippingInfoBuilder
of()
factory method for an instance of ShippingInfoBuilderstatic ShippingInfoBuilder
of
(ShippingInfo template) create builder for ShippingInfo instanceplusDeliveries
(Delivery... deliveries) Information on how items are delivered to customers.plusDeliveries
(Function<DeliveryBuilder, DeliveryBuilder> builder) Information on how items are delivered to customers.price
(CentPrecisionMoney price) Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or theshippingRateInput
field.Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or theshippingRateInput
field.setDeliveries
(Function<DeliveryBuilder, Delivery> builder) Information on how items are delivered to customers.shippingMethod
(ShippingMethodReference shippingMethod) Not set if a custom Shipping Method is used.Not set if a custom Shipping Method is used.shippingMethodName
(String shippingMethodName) Name of the Shipping Method.shippingMethodState
(ShippingMethodState shippingMethodState) Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.shippingRate
(ShippingRate shippingRate) Used to determine the price.Used to determine the price.taxCategory
(TaxCategoryReference taxCategory) Used to select a Tax Rate when a Cart has thePlatform
TaxMode.Used to select a Tax Rate when a Cart has thePlatform
TaxMode.taxedPrice
(TaxedItemPrice taxedPrice) Automatically set after thetaxRate
is set.Automatically set after thetaxRate
is set.Automatically set in thePlatform
TaxMode after the shipping address is set.taxRate
(Function<TaxRateBuilder, TaxRateBuilder> builder) Automatically set in thePlatform
TaxMode after the shipping address is set.withDeliveries
(Function<DeliveryBuilder, DeliveryBuilder> builder) Information on how items are delivered to customers.Discounted price of the Shipping Method.Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or theshippingRateInput
field.Not set if a custom Shipping Method is used.Used to determine the price.Used to select a Tax Rate when a Cart has thePlatform
TaxMode.Automatically set after thetaxRate
is set.withTaxRate
(Function<TaxRateBuilder, TaxRate> builder) Automatically set in thePlatform
TaxMode after the shipping address is set.
-
Constructor Details
-
ShippingInfoBuilder
public ShippingInfoBuilder()
-
-
Method Details
-
shippingMethodName
Name of the Shipping Method.
- Parameters:
shippingMethodName
- value to be set- Returns:
- Builder
-
price
public ShippingInfoBuilder price(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the
shippingRateInput
field.- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
withPrice
public ShippingInfoBuilder withPrice(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the
shippingRateInput
field.- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
price
Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the
shippingRateInput
field.- Parameters:
price
- value to be set- Returns:
- Builder
-
shippingRate
Used to determine the price.
- Parameters:
builder
- function to build the shippingRate value- Returns:
- Builder
-
withShippingRate
Used to determine the price.
- Parameters:
builder
- function to build the shippingRate value- Returns:
- Builder
-
shippingRate
Used to determine the price.
- Parameters:
shippingRate
- value to be set- Returns:
- Builder
-
taxedPrice
public ShippingInfoBuilder taxedPrice(Function<TaxedItemPriceBuilder, TaxedItemPriceBuilder> builder) Automatically set after the
taxRate
is set.- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
withTaxedPrice
Automatically set after the
taxRate
is set.- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
taxedPrice
Automatically set after the
taxRate
is set.- Parameters:
taxedPrice
- value to be set- Returns:
- Builder
-
taxRate
Automatically set in the
Platform
TaxMode after the shipping address is set.For the
External
TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
-
withTaxRate
Automatically set in the
Platform
TaxMode after the shipping address is set.For the
External
TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
-
taxRate
Automatically set in the
Platform
TaxMode after the shipping address is set.For the
External
TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.- Parameters:
taxRate
- value to be set- Returns:
- Builder
-
taxCategory
public ShippingInfoBuilder taxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReferenceBuilder> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ShippingInfoBuilder withTaxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReference> builder) Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
shippingMethod
public ShippingInfoBuilder shippingMethod(Function<ShippingMethodReferenceBuilder, ShippingMethodReferenceBuilder> builder) Not set if a custom Shipping Method is used.
- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
withShippingMethod
public ShippingInfoBuilder withShippingMethod(Function<ShippingMethodReferenceBuilder, ShippingMethodReference> builder) Not set if a custom Shipping Method is used.
- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
shippingMethod
Not set if a custom Shipping Method is used.
- Parameters:
shippingMethod
- value to be set- Returns:
- Builder
-
deliveries
Information on how items are delivered to customers.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
deliveries
Information on how items are delivered to customers.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
Information on how items are delivered to customers.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
Information on how items are delivered to customers.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
withDeliveries
Information on how items are delivered to customers.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
addDeliveries
Information on how items are delivered to customers.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
setDeliveries
Information on how items are delivered to customers.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
discountedPrice
public ShippingInfoBuilder discountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPriceBuilder> builder) Discounted price of the Shipping Method.
- Parameters:
builder
- function to build the discountedPrice value- Returns:
- Builder
-
withDiscountedPrice
public ShippingInfoBuilder withDiscountedPrice(Function<DiscountedLineItemPriceBuilder, DiscountedLineItemPrice> builder) Discounted price of the Shipping Method.
- Parameters:
builder
- function to build the discountedPrice value- Returns:
- Builder
-
discountedPrice
Discounted price of the Shipping Method.
- Parameters:
discountedPrice
- value to be set- Returns:
- Builder
-
shippingMethodState
Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.
- Parameters:
shippingMethodState
- value to be set- Returns:
- Builder
-
getShippingMethodName
Name of the Shipping Method.
- Returns:
- shippingMethodName
-
getPrice
Determined based on the ShippingRate and its tiered prices, and either the sum of LineItem prices or the
shippingRateInput
field.- Returns:
- price
-
getShippingRate
Used to determine the price.
- Returns:
- shippingRate
-
getTaxedPrice
Automatically set after the
taxRate
is set.- Returns:
- taxedPrice
-
getTaxRate
Automatically set in the
Platform
TaxMode after the shipping address is set.For the
External
TaxMode the Tax Rate must be set explicitly with the ExternalTaxRateDraft.- Returns:
- taxRate
-
getTaxCategory
Used to select a Tax Rate when a Cart has the
Platform
TaxMode.- Returns:
- taxCategory
-
getShippingMethod
Not set if a custom Shipping Method is used.
- Returns:
- shippingMethod
-
getDeliveries
Information on how items are delivered to customers.
- Returns:
- deliveries
-
getDiscountedPrice
Discounted price of the Shipping Method.
- Returns:
- discountedPrice
-
getShippingMethodState
Indicates whether the ShippingMethod referenced in this ShippingInfo is allowed for the Cart.
- Returns:
- shippingMethodState
-
build
builds ShippingInfo with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShippingInfo>
- Returns:
- ShippingInfo
-
buildUnchecked
builds ShippingInfo without checking for non-null required values- Returns:
- ShippingInfo
-
of
factory method for an instance of ShippingInfoBuilder- Returns:
- builder
-
of
create builder for ShippingInfo instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-