Class ProjectUpdateBuilder

java.lang.Object
com.commercetools.api.models.project.ProjectUpdateBuilder
All Implemented Interfaces:
Builder<ProjectUpdate>

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

     ProjectUpdate projectUpdate = ProjectUpdate.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • ProjectUpdateBuilder

      public ProjectUpdateBuilder()
  • Method Details

    • version

      public ProjectUpdateBuilder version(Long version)

      Expected version of the Project 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 ProjectUpdateBuilder actions(ProjectUpdateAction... actions)

      Update actions to be performed on the Project.

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

      public ProjectUpdateBuilder actions(List<ProjectUpdateAction> actions)

      Update actions to be performed on the Project.

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

      public ProjectUpdateBuilder plusActions(ProjectUpdateAction... actions)

      Update actions to be performed on the Project.

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

      Update actions to be performed on the Project.

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

      Update actions to be performed on the Project.

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

      public Long getVersion()

      Expected version of the Project 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<ProjectUpdateAction> getActions()

      Update actions to be performed on the Project.

      Returns:
      actions
    • build

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

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

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

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