Class DataFlowParameterResolution

java.lang.Object
com.espertech.esper.common.client.dataflow.util.DataFlowParameterResolution

public class DataFlowParameterResolution extends Object
Utility for data flow parameter resolution that considers parameter providers that are passed in.
  • Constructor Details

    • DataFlowParameterResolution

      public DataFlowParameterResolution()
  • Method Details

    • resolveNumber

      public static Number resolveNumber(String name, ExprEvaluator optionalEvaluator, Number defaultValue, DataFlowOpInitializeContext context)
      Resolve a number value by first looking at the parameter value provider and by using the evaluator if one was provided, returning the default value if no value was found and no evaluator was provided.
      Parameters:
      name - parameter name
      optionalEvaluator - evaluator
      defaultValue - default
      context - initialization context
      Returns:
      value
    • resolveStringRequired

      public static String resolveStringRequired(String name, ExprEvaluator optionalEvaluator, DataFlowOpInitializeContext context)
      Resolve a string value by first looking at the parameter value provider and by using the evaluator if one was provided, throwing an exception if no value was provided.
      Parameters:
      name - parameter name
      optionalEvaluator - evaluator
      context - initialization context
      Returns:
      value
      Throws:
      EPException - if no value was found
    • resolveStringOptional

      public static String resolveStringOptional(String name, ExprEvaluator optionalEvaluator, DataFlowOpInitializeContext context)
      Resolve a string value by first looking at the parameter value provider and by using the evaluator if one was provided or returning null if no value was found.
      Parameters:
      name - parameter name
      optionalEvaluator - evaluator
      context - initialization context
      Returns:
      value
      Throws:
      EPException - if no value was found
    • resolveWithDefault

      public static <T> T resolveWithDefault(String name, ExprEvaluator optionalEvaluator, T defaultValue, Class<T> clazz, DataFlowOpInitializeContext context)
      Resolve a typed value by first looking at the parameter value provider and by using the evaluator if one was provided or returning the provided default value if no value was found.
      Type Parameters:
      T - the type of value
      Parameters:
      name - parameter name
      optionalEvaluator - evaluator
      context - initialization context
      clazz - type of value
      defaultValue - default value
      Returns:
      value
    • resolveOptionalInstance

      public static <T> T resolveOptionalInstance(String name, Map<String,Object> configuration, Class<T> clazz, DataFlowOpInitializeContext context)
      Resolve an instance from a class-name map.
      Type Parameters:
      T - type of value returned
      Parameters:
      name - parameter name
      configuration - map with key 'class' for the class name
      clazz - expected interface or supertype
      context - initialization context
      Returns:
      instance
    • resolveMap

      public static Map<String,Object> resolveMap(String name, Map<String,Object> evals, DataFlowOpInitializeContext context)
      Resolve all entries in the map by first looking at the parameter value provider and by using the evaluator if one was provided or returning the provided value if no evaluator was found.
      Parameters:
      name - parameter name
      evals - map of properties with either evaluator or constant type
      context - initialization context
      Returns:
      value