Interface ExtensionTrigger


public interface ExtensionTrigger
ExtensionTrigger
Example to create an instance using the builder pattern

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

    • getResourceTypeId

      @NotNull @NotNull ExtensionResourceTypeId getResourceTypeId()

      The resource that triggers the Extension.

      Returns:
      resourceTypeId
    • getActions

      @NotNull @NotNull List<ExtensionAction> getActions()

      Create and Update requests are supported.

      Returns:
      actions
    • getCondition

      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
    • setResourceTypeId

      void setResourceTypeId(ExtensionResourceTypeId resourceTypeId)

      The resource that triggers the Extension.

      Parameters:
      resourceTypeId - value to be set
    • setActions

      void setActions(ExtensionAction... actions)

      Create and Update requests are supported.

      Parameters:
      actions - values to be set
    • setActions

      void setActions(List<ExtensionAction> actions)

      Create and Update requests are supported.

      Parameters:
      actions - values to be set
    • setCondition

      void setCondition(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
    • of

      static ExtensionTrigger of()
      factory method
      Returns:
      instance of ExtensionTrigger
    • of

      static ExtensionTrigger of(ExtensionTrigger template)
      factory method to create a shallow copy ExtensionTrigger
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ExtensionTrigger
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ExtensionTriggerBuilder builder()
      builder factory method for ExtensionTrigger
      Returns:
      builder
    • builder

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

      default <T> T withExtensionTrigger(Function<ExtensionTrigger,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ExtensionTrigger> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference