Class DataFlowParameterResolution
java.lang.Object
com.espertech.esper.common.client.dataflow.util.DataFlowParameterResolution
Utility for data flow parameter resolution that considers parameter providers that are passed in.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolveMap
(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.
-
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 nameoptionalEvaluator
- evaluatordefaultValue
- defaultcontext
- 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 nameoptionalEvaluator
- evaluatorcontext
- 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 nameoptionalEvaluator
- evaluatorcontext
- 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 nameoptionalEvaluator
- evaluatorcontext
- initialization contextclazz
- type of valuedefaultValue
- 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 nameconfiguration
- map with key 'class' for the class nameclazz
- expected interface or supertypecontext
- 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 nameevals
- map of properties with either evaluator or constant typecontext
- initialization context- Returns:
- value
-