Class CustomShippingDraftBuilder
- All Implemented Interfaces:
Builder<CustomShippingDraft>
Example to create an instance using the builder pattern
CustomShippingDraft customShippingDraft = CustomShippingDraft.builder()
.key("{key}")
.shippingMethodName("{shippingMethodName}")
.shippingRate(shippingRateBuilder -> shippingRateBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeliveries to be shipped with the custom Shipping Method.build()
builds CustomShippingDraft with checking for non-null required valuesbuilds CustomShippingDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the custom Shipping Method.Custom Fields for the custom Shipping Method.deliveries
(DeliveryDraft... deliveries) Deliveries to be shipped with the custom Shipping Method.deliveries
(List<DeliveryDraft> deliveries) Deliveries to be shipped with the custom Shipping Method.externalTaxRate
(ExternalTaxRateDraft externalTaxRate) Tax Rate used to tax a shipping expense if the Cart has theExternal
TaxMode.Tax Rate used to tax a shipping expense if the Cart has theExternal
TaxMode.Custom Fields for the custom Shipping Method.Deliveries to be shipped with the custom Shipping Method.Tax Rate used to tax a shipping expense if the Cart has theExternal
TaxMode.getKey()
User-defined unique identifier of the custom Shipping Method in the Cart withMultiple
ShippingMode.Determines the shipping rate and Tax Rate of the associated Line Items.Name of the custom Shipping Method.Determines the shipping price.Input used to select a ShippingRatePriceTier.Tax Category used to determine a shipping Tax Rate if the Cart has thePlatform
TaxMode.User-defined unique identifier of the custom Shipping Method in the Cart withMultiple
ShippingMode.static CustomShippingDraftBuilder
of()
factory method for an instance of CustomShippingDraftBuilderstatic CustomShippingDraftBuilder
of
(CustomShippingDraft template) create builder for CustomShippingDraft instanceplusDeliveries
(DeliveryDraft... deliveries) Deliveries to be shipped with the custom Shipping Method.Deliveries to be shipped with the custom Shipping Method.Deliveries to be shipped with the custom 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.shippingMethodName
(String shippingMethodName) Name of the custom Shipping Method.shippingRate
(ShippingRateDraft shippingRate) Determines the shipping price.Determines the shipping price.shippingRateInput
(ShippingRateInputDraft shippingRateInput) Input used to select a ShippingRatePriceTier.shippingRateInput
(Function<ShippingRateInputDraftBuilder, Builder<? extends ShippingRateInputDraft>> builder) Input used to select a ShippingRatePriceTier.taxCategory
(TaxCategoryResourceIdentifier taxCategory) Tax Category used to determine a shipping Tax Rate if the Cart has thePlatform
TaxMode.taxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) Tax Category used to determine a shipping Tax Rate if the Cart has thePlatform
TaxMode.Custom Fields for the custom Shipping Method.Deliveries to be shipped with the custom Shipping Method.Tax Rate used to tax a shipping expense if the Cart has theExternal
TaxMode.Determines the shipping rate and Tax Rate of the associated Line Items.Determines the shipping price.withTaxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) Tax Category used to determine a shipping Tax Rate if the Cart has thePlatform
TaxMode.
-
Constructor Details
-
CustomShippingDraftBuilder
public CustomShippingDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the custom Shipping Method in the Cart with
Multiple
ShippingMode.- Parameters:
key
- value to be set- Returns:
- Builder
-
shippingMethodName
Name of the custom Shipping Method.
- Parameters:
shippingMethodName
- value to be set- Returns:
- Builder
-
shippingAddress
public CustomShippingDraftBuilder 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
public CustomShippingDraftBuilder withShippingAddress(Function<BaseAddressBuilder, BaseAddress> builder) 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
-
shippingRate
public CustomShippingDraftBuilder shippingRate(Function<ShippingRateDraftBuilder, ShippingRateDraftBuilder> builder) Determines the shipping price.
- Parameters:
builder
- function to build the shippingRate value- Returns:
- Builder
-
withShippingRate
public CustomShippingDraftBuilder withShippingRate(Function<ShippingRateDraftBuilder, ShippingRateDraft> builder) Determines the shipping price.
- Parameters:
builder
- function to build the shippingRate value- Returns:
- Builder
-
shippingRate
Determines the shipping price.
- Parameters:
shippingRate
- value to be set- Returns:
- Builder
-
shippingRateInput
public CustomShippingDraftBuilder shippingRateInput(@Nullable ShippingRateInputDraft 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 CustomShippingDraftBuilder 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
-
taxCategory
public CustomShippingDraftBuilder taxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) Tax Category used to determine a shipping Tax Rate if the Cart has the
Platform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public CustomShippingDraftBuilder withTaxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) Tax Category used to determine a shipping Tax Rate if the Cart has the
Platform
TaxMode.- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
Tax Category used to determine a shipping Tax Rate if the Cart has the
Platform
TaxMode.- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
externalTaxRate
public CustomShippingDraftBuilder externalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraftBuilder> builder) Tax Rate used to tax a shipping expense if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
withExternalTaxRate
public CustomShippingDraftBuilder withExternalTaxRate(Function<ExternalTaxRateDraftBuilder, ExternalTaxRateDraft> builder) Tax Rate used to tax a shipping expense if the Cart has the
External
TaxMode.- Parameters:
builder
- function to build the externalTaxRate value- Returns:
- Builder
-
externalTaxRate
Tax Rate used to tax 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 custom Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
deliveries
Deliveries to be shipped with the custom Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
Deliveries to be shipped with the custom Shipping Method.
- Parameters:
deliveries
- value to be set- Returns:
- Builder
-
plusDeliveries
public CustomShippingDraftBuilder plusDeliveries(Function<DeliveryDraftBuilder, DeliveryDraftBuilder> builder) Deliveries to be shipped with the custom Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
withDeliveries
public CustomShippingDraftBuilder withDeliveries(Function<DeliveryDraftBuilder, DeliveryDraftBuilder> builder) Deliveries to be shipped with the custom Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
addDeliveries
public CustomShippingDraftBuilder addDeliveries(Function<DeliveryDraftBuilder, DeliveryDraft> builder) Deliveries to be shipped with the custom Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
setDeliveries
public CustomShippingDraftBuilder setDeliveries(Function<DeliveryDraftBuilder, DeliveryDraft> builder) Deliveries to be shipped with the custom Shipping Method.
- Parameters:
builder
- function to build the deliveries value- Returns:
- Builder
-
custom
public CustomShippingDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the custom Shipping Method.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public CustomShippingDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the custom Shipping Method.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the custom Shipping Method.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the custom Shipping Method in the Cart with
Multiple
ShippingMode.- Returns:
- key
-
getShippingMethodName
Name of the custom Shipping Method.
- Returns:
- shippingMethodName
-
getShippingAddress
Determines the shipping rate and Tax Rate of the associated Line Items.
- Returns:
- shippingAddress
-
getShippingRate
Determines the shipping price.
- Returns:
- shippingRate
-
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
-
getTaxCategory
Tax Category used to determine a shipping Tax Rate if the Cart has the
Platform
TaxMode.- Returns:
- taxCategory
-
getExternalTaxRate
Tax Rate used to tax a shipping expense if the Cart has the
External
TaxMode.- Returns:
- externalTaxRate
-
getDeliveries
Deliveries to be shipped with the custom Shipping Method.
- Returns:
- deliveries
-
getCustom
Custom Fields for the custom Shipping Method.
- Returns:
- custom
-
build
builds CustomShippingDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<CustomShippingDraft>
- Returns:
- CustomShippingDraft
-
buildUnchecked
builds CustomShippingDraft without checking for non-null required values- Returns:
- CustomShippingDraft
-
of
factory method for an instance of CustomShippingDraftBuilder- Returns:
- builder
-
of
create builder for CustomShippingDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-