Class MyCartSetShippingMethodActionBuilder

java.lang.Object
com.commercetools.api.models.me.MyCartSetShippingMethodActionBuilder
All Implemented Interfaces:
Builder<MyCartSetShippingMethodAction>

public class MyCartSetShippingMethodActionBuilder extends Object implements Builder<MyCartSetShippingMethodAction>
MyCartSetShippingMethodActionBuilder
Example to create an instance using the builder pattern

     MyCartSetShippingMethodAction myCartSetShippingMethodAction = MyCartSetShippingMethodAction.builder()
             .build()
 
  • Constructor Details

    • MyCartSetShippingMethodActionBuilder

      public MyCartSetShippingMethodActionBuilder()
  • Method Details

    • shippingMethod

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • withShippingMethod

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • shippingMethod

      public MyCartSetShippingMethodActionBuilder shippingMethod(@Nullable ShippingMethodResourceIdentifier shippingMethod)

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Parameters:
      shippingMethod - value to be set
      Returns:
      Builder
    • externalTaxRate

      An external Tax Rate can be set if the Cart has the External TaxMode.

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

      An external Tax Rate can be set if the Cart has the External TaxMode.

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

      public MyCartSetShippingMethodActionBuilder externalTaxRate(@Nullable ExternalTaxRateDraft externalTaxRate)

      An external Tax Rate can be set if the Cart has the External TaxMode.

      Parameters:
      externalTaxRate - value to be set
      Returns:
      Builder
    • getShippingMethod

      @Nullable public ShippingMethodResourceIdentifier getShippingMethod()

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Returns:
      shippingMethod
    • getExternalTaxRate

      @Nullable public ExternalTaxRateDraft getExternalTaxRate()

      An external Tax Rate can be set if the Cart has the External TaxMode.

      Returns:
      externalTaxRate
    • build

      builds MyCartSetShippingMethodAction with checking for non-null required values
      Specified by:
      build in interface Builder<MyCartSetShippingMethodAction>
      Returns:
      MyCartSetShippingMethodAction
    • buildUnchecked

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

      factory method for an instance of MyCartSetShippingMethodActionBuilder
      Returns:
      builder
    • of

      create builder for MyCartSetShippingMethodAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder