Class CartSetLineItemCustomFieldActionBuilder

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

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

     CartSetLineItemCustomFieldAction cartSetLineItemCustomFieldAction = CartSetLineItemCustomFieldAction.builder()
             .name("{name}")
             .build()
 
  • Constructor Details

    • CartSetLineItemCustomFieldActionBuilder

      public CartSetLineItemCustomFieldActionBuilder()
  • Method Details

    • lineItemId

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemId - value to be set
      Returns:
      Builder
    • lineItemKey

      public CartSetLineItemCustomFieldActionBuilder lineItemKey(@Nullable String lineItemKey)

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Parameters:
      lineItemKey - 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. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

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

      @Nullable public String getLineItemId()

      id of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemId
    • getLineItemKey

      @Nullable public String getLineItemKey()

      key of the LineItem to update. Either lineItemId or lineItemKey is required.

      Returns:
      lineItemKey
    • 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. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.

      Returns:
      value
    • build

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

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

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

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