Class RestRule

java.lang.Object
com.helixframework.rules.rule.BaseRule
com.helixframework.rules.rule.rest.RestRule
All Implemented Interfaces:
Rule

public class RestRule extends BaseRule
Rule that invokes a restful endpoint.
  • Method Details

    • builder

      public static RestRule.Builder builder(String name, String url)
      Builder for creating new instances of RestRule.
      Parameters:
      name - rule name
      url - rule endpoint url
      Returns:
      a RestRule.Builder
    • applyInternal

      protected void applyInternal(RuleContext ctx)
      Description copied from class: BaseRule
      Applies the logic of the implementing rule and modifies the root object in the context.
      Specified by:
      applyInternal in class BaseRule
      Parameters:
      ctx - rule context
    • applyInternal

      protected <T> T applyInternal(RuleContext<?> ctx, Class<T> outputType)
      Description copied from class: BaseRule
      Applies the logic of the implementing rule and returns the result.
      Specified by:
      applyInternal in class BaseRule
      Type Parameters:
      T - type of rule output
      Parameters:
      ctx - rule context
      outputType - type of rule output
      Returns:
      rule result
    • getType

      public RuleType getType()
      Description copied from interface: Rule
      Gets the type of rule.
      Returns:
      rule type
    • getUrl

      public String getUrl()
      Gets the url of the endpoint to call for the rule.
      Returns:
      rule url
    • toString

      public String toString()
      Overrides:
      toString in class Object