Class CartSetShippingCustomFieldActionBuilder

java.lang.Object
com.commercetools.api.models.cart.CartSetShippingCustomFieldActionBuilder
All Implemented Interfaces:
Builder<CartSetShippingCustomFieldAction>

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

     CartSetShippingCustomFieldAction cartSetShippingCustomFieldAction = CartSetShippingCustomFieldAction.builder()
             .name("{name}")
             .build()
 
  • Constructor Details

    • CartSetShippingCustomFieldActionBuilder

      public CartSetShippingCustomFieldActionBuilder()
  • Method Details

    • shippingKey

      public CartSetShippingCustomFieldActionBuilder shippingKey(@Nullable String shippingKey)

      The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize on a Cart with Multiple ShippingMode. Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

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

      Name of the Custom Field.

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

      If value is absent or null, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. If value is provided, it is set for the field defined by name.

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

      @Nullable public String getShippingKey()

      The shippingKey of the Shipping to customize. Used to specify which Shipping Method to customize on a Cart with Multiple ShippingMode. Leave this empty to customize the one and only ShippingMethod on a Single ShippingMode Cart.

      Returns:
      shippingKey
    • getName

      public String getName()

      Name of the Custom Field.

      Returns:
      name
    • getValue

      @Nullable public Object getValue()

      If value is absent or null, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. If value is provided, it is set for the field defined by name.

      Returns:
      value
    • build

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

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

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

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