Class UpdateBuilder

java.lang.Object
com.commercetools.api.models.common.UpdateBuilder
All Implemented Interfaces:
Builder<Update>

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

     Update update = Update.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • UpdateBuilder

      public UpdateBuilder()
  • Method Details

    • version

      public UpdateBuilder version(Long version)
      set the value to the version
      Parameters:
      version - value to be set
      Returns:
      Builder
    • actions

      public UpdateBuilder actions(UpdateAction... actions)
      set values to the actions
      Parameters:
      actions - value to be set
      Returns:
      Builder
    • actions

      public UpdateBuilder actions(List<UpdateAction> actions)
      set value to the actions
      Parameters:
      actions - value to be set
      Returns:
      Builder
    • plusActions

      public UpdateBuilder plusActions(UpdateAction... actions)
      add values to the actions
      Parameters:
      actions - value to be set
      Returns:
      Builder
    • plusActions

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

      set the value to the actions using the builder function
      Parameters:
      builder - function to build the actions value
      Returns:
      Builder
    • addActions

      add the value to the actions using the builder function
      Parameters:
      builder - function to build the actions value
      Returns:
      Builder
    • setActions

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

      public Long getVersion()
      value of version}
      Returns:
      version
    • getActions

      public List<UpdateAction> getActions()
      value of actions}
      Returns:
      actions
    • build

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

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

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

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