Class ShippingBuilder

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

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

     Shipping shipping = Shipping.builder()
             .shippingKey("{shippingKey}")
             .shippingInfo(shippingInfoBuilder -> shippingInfoBuilder)
             .shippingAddress(shippingAddressBuilder -> shippingAddressBuilder)
             .build()
 
  • Constructor Details

  • Method Details

    • shippingKey

      public ShippingBuilder shippingKey(String shippingKey)

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

      Parameters:
      shippingKey - value to be set
      Returns:
      Builder
    • shippingInfo

      Automatically set when the Shipping Method is added.

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

      Automatically set when the Shipping Method is added.

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

      public ShippingBuilder shippingInfo(ShippingInfo shippingInfo)

      Automatically set when the Shipping Method is added.

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

      Determines the shipping rates and Tax Rates of associated Line Items.

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

      Determines the shipping rates and Tax Rates of associated Line Items.

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

      public ShippingBuilder shippingAddress(Address shippingAddress)

      Determines the shipping rates and Tax Rates of associated Line Items.

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

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Parameters:
      shippingRateInput - value to be set
      Returns:
      Builder
    • shippingRateInput

      public ShippingBuilder shippingRateInput(Function<ShippingRateInputBuilder,io.vrap.rmf.base.client.Builder<? extends ShippingRateInput>> builder)

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Parameters:
      builder - function to build the shippingRateInput value
      Returns:
      Builder
    • shippingCustomFields

      Custom Fields of Shipping with Multiple ShippingMode.

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

      Custom Fields of Shipping with Multiple ShippingMode.

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

      Custom Fields of Shipping with Multiple ShippingMode.

      Parameters:
      shippingCustomFields - value to be set
      Returns:
      Builder
    • getShippingKey

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

      Returns:
      shippingKey
    • getShippingInfo

      Automatically set when the Shipping Method is added.

      Returns:
      shippingInfo
    • getShippingAddress

      Determines the shipping rates and Tax Rates of associated Line Items.

      Returns:
      shippingAddress
    • getShippingRateInput

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Returns:
      shippingRateInput
    • getShippingCustomFields

      Custom Fields of Shipping with Multiple ShippingMode.

      Returns:
      shippingCustomFields
    • build

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

      builds Shipping without checking for non-null required values
      Returns:
      Shipping
    • of

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

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