Interface ShippingDraft
- All Superinterfaces:
Draft<ShippingDraft>
,WithKey
Wraps all shipping-related information (such as address, rate, deliveries) per Shipping Method for Carts with multiple Shipping Methods.
Example to create an instance using the builder pattern
ShippingDraft shippingDraft = ShippingDraft.builder()
.key("{key}")
.shippingAddress(shippingAddressBuilder -> shippingAddressBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShippingDraftBuilder
builder()
builder factory method for ShippingDraftstatic ShippingDraftBuilder
builder
(ShippingDraft template) create builder for ShippingDraft instancestatic ShippingDraft
deepCopy
(ShippingDraft template) factory method to create a deep copy of ShippingDraft@Valid CustomFieldsDraft
Custom Fields for Shipping.@Valid List<DeliveryDraft>
Deliveries to be shipped with the Shipping Method.@Valid ExternalTaxRateDraft
Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.@NotNull String
getKey()
User-defined unique identifier for the Shipping in a Cart withMultiple
ShippingMode.@NotNull @Valid BaseAddress
Determines the shipping rate and Tax Rate of the associated Line Items.@Valid ShippingMethodReference
Shipping Methods added to the Cart withMultiple
ShippingMode.@Valid ShippingRateInputDraft
Input used to select a ShippingRatePriceTier.static ShippingDraft
of()
factory methodstatic ShippingDraft
of
(ShippingDraft template) factory method to create a shallow copy ShippingDraftvoid
setCustom
(CustomFieldsDraft custom) Custom Fields for Shipping.void
setDeliveries
(DeliveryDraft... deliveries) Deliveries to be shipped with the Shipping Method.void
setDeliveries
(List<DeliveryDraft> deliveries) Deliveries to be shipped with the Shipping Method.void
setExternalTaxRate
(ExternalTaxRateDraft externalTaxRate) Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.void
User-defined unique identifier for the Shipping in a Cart withMultiple
ShippingMode.void
setShippingAddress
(BaseAddress shippingAddress) Determines the shipping rate and Tax Rate of the associated Line Items.void
setShippingMethod
(ShippingMethodReference shippingMethod) Shipping Methods added to the Cart withMultiple
ShippingMode.void
setShippingRateInput
(ShippingRateInputDraft shippingRateInput) Input used to select a ShippingRatePriceTier.static com.fasterxml.jackson.core.type.TypeReference<ShippingDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withShippingDraft
(Function<ShippingDraft, T> helper) accessor map function
-
Method Details
-
getKey
User-defined unique identifier for the Shipping in a Cart with
Multiple
ShippingMode. -
getShippingMethod
Shipping Methods added to the Cart with
Multiple
ShippingMode.- Returns:
- shippingMethod
-
getShippingAddress
Determines the shipping rate and Tax Rate of the associated Line Items.
- Returns:
- shippingAddress
-
getShippingRateInput
Input used to select a ShippingRatePriceTier. The data type of this field depends on the
shippingRateInputType.type
configured in the Project:- If
CartClassification
, it must be ClassificationShippingRateInputDraft. - If
CartScore
, it must be ScoreShippingRateInputDraft. - If
CartValue
, it cannot be set.
- Returns:
- shippingRateInput
- If
-
getExternalTaxRate
Tax Rate used for taxing a shipping expense if the Cart has the
External
TaxMode.- Returns:
- externalTaxRate
-
getDeliveries
Deliveries to be shipped with the Shipping Method.
- Returns:
- deliveries
-
getCustom
Custom Fields for Shipping.
- Returns:
- custom
-
setKey
User-defined unique identifier for the Shipping in a Cart with
Multiple
ShippingMode.- Parameters:
key
- value to be set
-
setShippingMethod
Shipping Methods added to the Cart with
Multiple
ShippingMode.- Parameters:
shippingMethod
- value to be set
-
setShippingAddress
Determines the shipping rate and Tax Rate of the associated Line Items.
- Parameters:
shippingAddress
- value to be set
-
setShippingRateInput
Input used to select a ShippingRatePriceTier. The data type of this field depends on the
shippingRateInputType.type
configured in the Project:- If
CartClassification
, it must be ClassificationShippingRateInputDraft. - If
CartScore
, it must be ScoreShippingRateInputDraft. - If
CartValue
, it cannot be set.
- Parameters:
shippingRateInput
- value to be set
- If
-
setExternalTaxRate
Tax Rate used for taxing a shipping expense if the Cart has the
External
TaxMode.- Parameters:
externalTaxRate
- value to be set
-
setDeliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
deliveries
- values to be set
-
setDeliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
deliveries
- values to be set
-
setCustom
Custom Fields for Shipping.
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of ShippingDraft
-
of
factory method to create a shallow copy ShippingDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ShippingDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShippingDraft- Returns:
- builder
-
builder
create builder for ShippingDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withShippingDraft
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
-