Class ProductUpdateBuilder

java.lang.Object
com.commercetools.api.models.product.ProductUpdateBuilder
All Implemented Interfaces:
Builder<ProductUpdate>

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

     ProductUpdate productUpdate = ProductUpdate.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • ProductUpdateBuilder

      public ProductUpdateBuilder()
  • Method Details

    • version

      public ProductUpdateBuilder version(Long version)

      Expected version of the Product 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 ProductUpdateBuilder actions(ProductUpdateAction... actions)

      Update actions to be performed on the Product.

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

      public ProductUpdateBuilder actions(List<ProductUpdateAction> actions)

      Update actions to be performed on the Product.

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

      public ProductUpdateBuilder plusActions(ProductUpdateAction... actions)

      Update actions to be performed on the Product.

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

      Update actions to be performed on the Product.

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

      Update actions to be performed on the Product.

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

      public Long getVersion()

      Expected version of the Product 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<ProductUpdateAction> getActions()

      Update actions to be performed on the Product.

      Returns:
      actions
    • build

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

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

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

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