Class MyCartUpdateBuilder

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

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

     MyCartUpdate myCartUpdate = MyCartUpdate.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • MyCartUpdateBuilder

      public MyCartUpdateBuilder()
  • Method Details

    • version

      public MyCartUpdateBuilder version(Long version)

      Expected version of the Cart on which the changes apply. 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 MyCartUpdateBuilder actions(MyCartUpdateAction... actions)

      Update actions to be performed on the Cart.

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

      public MyCartUpdateBuilder actions(List<MyCartUpdateAction> actions)

      Update actions to be performed on the Cart.

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

      public MyCartUpdateBuilder plusActions(MyCartUpdateAction... actions)

      Update actions to be performed on the Cart.

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

      Update actions to be performed on the Cart.

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

      Update actions to be performed on the Cart.

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

      public Long getVersion()

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

      Returns:
      version
    • getActions

      public List<MyCartUpdateAction> getActions()

      Update actions to be performed on the Cart.

      Returns:
      actions
    • build

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

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

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

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