Class ExtensionTriggerBuilder

java.lang.Object
com.commercetools.api.models.extension.ExtensionTriggerBuilder
All Implemented Interfaces:
Builder<ExtensionTrigger>

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

     ExtensionTrigger extensionTrigger = ExtensionTrigger.builder()
             .resourceTypeId(ExtensionResourceTypeId.CART)
             .plusActions(actionsBuilder -> actionsBuilder)
             .build()
 
  • Constructor Details

    • ExtensionTriggerBuilder

      public ExtensionTriggerBuilder()
  • Method Details

    • resourceTypeId

      public ExtensionTriggerBuilder resourceTypeId(ExtensionResourceTypeId resourceTypeId)

      The resource that triggers the Extension.

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

      public ExtensionTriggerBuilder actions(ExtensionAction... actions)

      Create and Update requests are supported.

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

      public ExtensionTriggerBuilder actions(List<ExtensionAction> actions)

      Create and Update requests are supported.

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

      public ExtensionTriggerBuilder plusActions(ExtensionAction... actions)

      Create and Update requests are supported.

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

      public ExtensionTriggerBuilder condition(@Nullable String condition)

      Valid predicate that controls the conditions under which the API Extension is called. The Extension is not triggered when the specified condition is not fulfilled.

      Parameters:
      condition - value to be set
      Returns:
      Builder
    • getResourceTypeId

      public ExtensionResourceTypeId getResourceTypeId()

      The resource that triggers the Extension.

      Returns:
      resourceTypeId
    • getActions

      public List<ExtensionAction> getActions()

      Create and Update requests are supported.

      Returns:
      actions
    • getCondition

      @Nullable public String getCondition()

      Valid predicate that controls the conditions under which the API Extension is called. The Extension is not triggered when the specified condition is not fulfilled.

      Returns:
      condition
    • build

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

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

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

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