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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,Object>
    resolveMap(String name, Map<String,Object> evals, com.espertech.esper.common.internal.epl.dataflow.interfaces.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.
    static Number
    resolveNumber(String name, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, Number defaultValue, com.espertech.esper.common.internal.epl.dataflow.interfaces.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.
    static <T> T
    resolveOptionalInstance(String name, Map<String,Object> configuration, Class<T> clazz, com.espertech.esper.common.internal.epl.dataflow.interfaces.DataFlowOpInitializeContext context)
    Resolve an instance from a class-name map.
    static String
    resolveStringOptional(String name, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, com.espertech.esper.common.internal.epl.dataflow.interfaces.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.
    static String
    resolveStringRequired(String name, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, com.espertech.esper.common.internal.epl.dataflow.interfaces.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.
    static <T> T
    resolveWithDefault(String name, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, T defaultValue, Class<T> clazz, com.espertech.esper.common.internal.epl.dataflow.interfaces.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DataFlowParameterResolution

      public DataFlowParameterResolution()
  • Method Details

    • resolveNumber

      public static Number resolveNumber(String name, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, Number defaultValue, com.espertech.esper.common.internal.epl.dataflow.interfaces.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, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, com.espertech.esper.common.internal.epl.dataflow.interfaces.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, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, com.espertech.esper.common.internal.epl.dataflow.interfaces.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, com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator optionalEvaluator, T defaultValue, Class<T> clazz, com.espertech.esper.common.internal.epl.dataflow.interfaces.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, com.espertech.esper.common.internal.epl.dataflow.interfaces.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, com.espertech.esper.common.internal.epl.dataflow.interfaces.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