Class ShippingDraftBuilder
- All Implemented Interfaces:
Builder<ShippingDraft>
Example to create an instance using the builder pattern
ShippingDraft shippingDraft = ShippingDraft.builder()
.key("{key}")
.shippingAddress(shippingAddressBuilder -> shippingAddressBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeliveries to be shipped with the Shipping Method.build()
builds ShippingDraft with checking for non-null required valuesbuilds ShippingDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for Shipping.Custom Fields for Shipping.deliveries
(DeliveryDraft... deliveries) Deliveries to be shipped with the Shipping Method.deliveries
(List<DeliveryDraft> deliveries) Deliveries to be shipped with the Shipping Method.externalTaxRate
(ExternalTaxRateDraft externalTaxRate) Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.Custom Fields for Shipping.Deliveries to be shipped with the Shipping Method.Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.getKey()
User-defined unique identifier for the Shipping in a Cart withMultiple
ShippingMode.Determines the shipping rate and Tax Rate of the associated Line Items.Shipping Methods added to the Cart withMultiple
ShippingMode.Input used to select a ShippingRatePriceTier.User-defined unique identifier for the Shipping in a Cart withMultiple
ShippingMode.static ShippingDraftBuilder
of()
factory method for an instance of ShippingDraftBuilderstatic ShippingDraftBuilder
of
(ShippingDraft template) create builder for ShippingDraft instanceplusDeliveries
(DeliveryDraft... deliveries) Deliveries to be shipped with the Shipping Method.Deliveries to be shipped with the Shipping Method.Deliveries to be shipped with the Shipping Method.shippingAddress
(BaseAddress shippingAddress) Determines the shipping rate and Tax Rate of the associated Line Items.Determines the shipping rate and Tax Rate of the associated Line Items.shippingMethod
(ShippingMethodReference shippingMethod) Shipping Methods added to the Cart withMultiple
ShippingMode.Shipping Methods added to the Cart withMultiple
ShippingMode.shippingRateInput
(ShippingRateInputDraft shippingRateInput) Input used to select a ShippingRatePriceTier.shippingRateInput
(Function<ShippingRateInputDraftBuilder, Builder<? extends ShippingRateInputDraft>> builder) Input used to select a ShippingRatePriceTier.Custom Fields for Shipping.Deliveries to be shipped with the Shipping Method.Tax Rate used for taxing a shipping expense if the Cart has theExternal
TaxMode.Determines the shipping rate and Tax Rate of the associated Line Items.Shipping Methods added to the Cart withMultiple
ShippingMode.
-
Constructor Details
-
ShippingDraftBuilder
public ShippingDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the Shipping in a Cart with
Multiple
ShippingMode.- Parameters:
key
- value to be set- Returns:
- Builder
-
shippingMethod
public ShippingDraftBuilder shippingMethod(Function<ShippingMethodReferenceBuilder, ShippingMethodReferenceBuilder> builder) Shipping Methods added to the Cart with
Multiple
ShippingMode.- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
withShippingMethod
public ShippingDraftBuilder withShippingMethod(Function<ShippingMethodReferenceBuilder, ShippingMethodReference> builder) Shipping Methods added to the Cart with
Multiple
ShippingMode.- Parameters:
builder
- function to build the shippingMethod value- Returns:
- Builder
-
shippingMethod
Shipping Methods added to the Cart with
Multiple
ShippingMode.- Parameters:
shippingMethod
- value to be set- Returns:
- Builder
-
shippingAddress
public ShippingDraftBuilder shippingAddress(Function<BaseAddressBuilder, BaseAddressBuilder> builder) Determines the shipping rate and Tax Rate of the associated Line Items.
- Parameters:
builder
- function to build the shippingAddress value- Returns:
- Builder
-
withShippingAddress
Determines the shipping rate and Tax Rate of the associated Line Items.
- Parameters:
builder
- function to build the shippingAddress value- Returns:
- Builder
-
shippingAddress
Determines the shipping rate and Tax Rate of the associated Line Items.
- Parameters:
shippingAddress
- value to be set- Returns:
- Builder
-
shippingRateInput
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- Returns:
- Builder
- If
-
shippingRateInput
public ShippingDraftBuilder shippingRateInput(Function<ShippingRateInputDraftBuilder, Builder<? extends ShippingRateInputDraft>> builder) 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:
builder
- function to build the shippingRateInput value- Returns:
- Builder
- If
-
externalTaxRate
public ShippingDraftBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) Tax Rate used for taxing a shipping expense if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public ShippingDraftBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) Tax Rate used for taxing a shipping expense if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
Tax Rate used for taxing a shipping expense if the Cart has the
External
TaxMode.- Parameters:
externalTaxRate
- value to be set- Returns:
- Builder
-
deliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
deliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
public ShippingDraftBuilder plusDeliveries(Function<DeliveryDraftBuilder, DeliveryDraftBuilder> builder) Deliveries to be shipped with the Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
withDeliveries
public ShippingDraftBuilder withDeliveries(Function<DeliveryDraftBuilder, DeliveryDraftBuilder> builder) Deliveries to be shipped with the Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
addDeliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
setDeliveries
Deliveries to be shipped with the Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
custom
public ShippingDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for Shipping.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public ShippingDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for Shipping.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for Shipping.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier for the Shipping in a Cart with
Multiple
ShippingMode.- Returns:
- key
-
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
-
build
builds ShippingDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShippingDraft>
- Returns:
- ShippingDraft
-
buildUnchecked
builds ShippingDraft without checking for non-null required values- Returns:
- ShippingDraft
-
of
factory method for an instance of ShippingDraftBuilder- Returns:
- builder
-
of
create builder for ShippingDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-