Class ShippingDraftBuilder

java.lang.Object
com.commercetools.api.models.cart.ShippingDraftBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ShippingDraft>

public class ShippingDraftBuilder extends Object implements io.vrap.rmf.base.client.Builder<ShippingDraft>
ShippingDraftBuilder
Example to create an instance using the builder pattern

     ShippingDraft shippingDraft = ShippingDraft.builder()
             .key("{key}")
             .shippingAddress(shippingAddressBuilder -> shippingAddressBuilder)
             .build()
 
  • Constructor Details

    • ShippingDraftBuilder

      public ShippingDraftBuilder()
  • Method Details

    • key

      public ShippingDraftBuilder key(String key)

      User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • shippingMethod

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • withShippingMethod

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • shippingMethod

      public ShippingDraftBuilder shippingMethod(@Nullable ShippingMethodReference shippingMethod)

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Parameters:
      shippingMethod - value to be set
      Returns:
      Builder
    • shippingAddress

      Determines the shipping rate and Tax Rate of the associated Line Items.

      Parameters:
      builder - function to build the shippingAddress value
      Returns:
      Builder
    • withShippingAddress

      public ShippingDraftBuilder 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

      public ShippingDraftBuilder shippingAddress(BaseAddress shippingAddress)

      Determines the shipping rate and Tax Rate of the associated Line Items.

      Parameters:
      shippingAddress - value to be set
      Returns:
      Builder
    • shippingRateInput

      public ShippingDraftBuilder 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
    • shippingRateInput

      public ShippingDraftBuilder shippingRateInput(Function<ShippingRateInputDraftBuilder,io.vrap.rmf.base.client.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
    • externalTaxRate

      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

      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

      public ShippingDraftBuilder externalTaxRate(@Nullable ExternalTaxRateDraft 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

      public ShippingDraftBuilder deliveries(@Nullable DeliveryDraft... deliveries)

      Deliveries to be shipped with the Shipping Method.

      Parameters:
      deliveries - value to be set
      Returns:
      Builder
    • deliveries

      public ShippingDraftBuilder deliveries(@Nullable List<DeliveryDraft> deliveries)

      Deliveries to be shipped with the Shipping Method.

      Parameters:
      deliveries - value to be set
      Returns:
      Builder
    • plusDeliveries

      public ShippingDraftBuilder plusDeliveries(@Nullable DeliveryDraft... 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:
      builder - function to build the deliveries value
      Returns:
      Builder
    • withDeliveries

      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

      Custom Fields for Shipping.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      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

      public String getKey()

      User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

      Returns:
      key
    • getShippingMethod

      @Nullable public ShippingMethodReference getShippingMethod()

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Returns:
      shippingMethod
    • getShippingAddress

      public BaseAddress getShippingAddress()

      Determines the shipping rate and Tax Rate of the associated Line Items.

      Returns:
      shippingAddress
    • getShippingRateInput

      @Nullable public ShippingRateInputDraft 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
    • getExternalTaxRate

      @Nullable public ExternalTaxRateDraft getExternalTaxRate()

      Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

      Returns:
      externalTaxRate
    • getDeliveries

      @Nullable public List<DeliveryDraft> getDeliveries()

      Deliveries to be shipped with the Shipping Method.

      Returns:
      deliveries
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for Shipping.

      Returns:
      custom
    • build

      public ShippingDraft build()
      builds ShippingDraft with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ShippingDraft>
      Returns:
      ShippingDraft
    • buildUnchecked

      public ShippingDraft buildUnchecked()
      builds ShippingDraft without checking for non-null required values
      Returns:
      ShippingDraft
    • of

      public static ShippingDraftBuilder of()
      factory method for an instance of ShippingDraftBuilder
      Returns:
      builder
    • of

      public static ShippingDraftBuilder of(ShippingDraft template)
      create builder for ShippingDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder