Class CartDiscountUpdateBuilder

java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountUpdateBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<CartDiscountUpdate>

public class CartDiscountUpdateBuilder extends Object implements io.vrap.rmf.base.client.Builder<CartDiscountUpdate>
CartDiscountUpdateBuilder
Example to create an instance using the builder pattern

     CartDiscountUpdate cartDiscountUpdate = CartDiscountUpdate.builder()
             .version(0.3)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • CartDiscountUpdateBuilder

      public CartDiscountUpdateBuilder()
  • Method Details

    • version

      public CartDiscountUpdateBuilder version(Long version)

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

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

      Update actions to be performed on the CartDiscount.

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

      Update actions to be performed on the CartDiscount.

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

      public CartDiscountUpdateBuilder plusActions(CartDiscountUpdateAction... actions)

      Update actions to be performed on the CartDiscount.

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

      public CartDiscountUpdateBuilder plusActions(Function<CartDiscountUpdateActionBuilder,io.vrap.rmf.base.client.Builder<? extends CartDiscountUpdateAction>> builder)

      Update actions to be performed on the CartDiscount.

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

      public CartDiscountUpdateBuilder withActions(Function<CartDiscountUpdateActionBuilder,io.vrap.rmf.base.client.Builder<? extends CartDiscountUpdateAction>> builder)

      Update actions to be performed on the CartDiscount.

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

      public Long getVersion()

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

      Returns:
      version
    • getActions

      public List<CartDiscountUpdateAction> getActions()

      Update actions to be performed on the CartDiscount.

      Returns:
      actions
    • build

      public CartDiscountUpdate build()
      builds CartDiscountUpdate with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<CartDiscountUpdate>
      Returns:
      CartDiscountUpdate
    • buildUnchecked

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

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

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