Class OrderUpdateBuilder

java.lang.Object
com.commercetools.api.models.order.OrderUpdateBuilder
All Implemented Interfaces:
Builder<OrderUpdate>

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

     OrderUpdate orderUpdate = OrderUpdate.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • OrderUpdateBuilder

      public OrderUpdateBuilder()
  • Method Details

    • version

      public OrderUpdateBuilder version(Long version)

      Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • actions

      public OrderUpdateBuilder actions(OrderUpdateAction... actions)

      Update actions to be performed on the Order.

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

      public OrderUpdateBuilder actions(List<OrderUpdateAction> actions)

      Update actions to be performed on the Order.

      Parameters:
      actions - value to be set
      Returns:
      Builder
    • plusActions

      public OrderUpdateBuilder plusActions(OrderUpdateAction... actions)

      Update actions to be performed on the Order.

      Parameters:
      actions - value to be set
      Returns:
      Builder
    • plusActions

      Update actions to be performed on the Order.

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

      Update actions to be performed on the Order.

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

      public Long getVersion()

      Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned.

      Returns:
      version
    • getActions

      public List<OrderUpdateAction> getActions()

      Update actions to be performed on the Order.

      Returns:
      actions
    • build

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

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

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

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