Class EvaluatorState
java.lang.Object
org.apache.nifi.attribute.expression.language.evaluation.EvaluatorState
A storage mechanism for
Evaluator
s to stash invalid input: '&' retrieve state. While most Evaluators are stateless,
some must maintain state, for instance to iterate over many Attributes. By stashing that state and retrieving
it from this EvaluatorState instead of using member variables, Evaluators are able to be kept both threadsafe
and in-and-of-themselves stateless, which means that new Evaluators need not be created for each iteration of
the function.-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
statePerEvaluator
-
-
Constructor Details
-
EvaluatorState
public EvaluatorState()
-
-
Method Details
-
getState
Fetches state for the given evaluator, casting it into the given type- Type Parameters:
T
- type Type of the value- Parameters:
evaluator
- the Evaluator to retrieve state forclazz
- the Class to which the value should be cast- Returns:
- the state for the given Evaluator, or
null
if no state has been stored
-
putState
Updates state for the given Evaluator- Parameters:
evaluator
- the Evaluator to store state forstate
- the state to store
-