OutputType - The output type of the evaluator.public class ConstantEvaluator<OutputType> extends AbstractCloneableSerializable implements Evaluator<java.lang.Object,OutputType>
ConstantEvaluator class implements an Evaluator that
always returns the same output value.| Modifier and Type | Field and Description |
|---|---|
protected OutputType |
value
The output value.
|
| Constructor and Description |
|---|
ConstantEvaluator()
Creates a new
ConstantEvaluator. |
ConstantEvaluator(OutputType value)
Creates a new
ConstantEvaluator. |
| Modifier and Type | Method and Description |
|---|---|
static <OutputType> |
create(OutputType value)
Creates a new
ConstantEvaluator for the given value. |
OutputType |
evaluate(java.lang.Object input)
Evaluating this object just returns the constant output value.
|
OutputType |
getValue()
Gets the constant output value for the evaluator.
|
void |
setValue(OutputType value)
Sets the constant output value for the evaluator.
|
cloneprotected OutputType value
public ConstantEvaluator()
ConstantEvaluator.public ConstantEvaluator(OutputType value)
ConstantEvaluator.value - The constant output value.public OutputType evaluate(java.lang.Object input)
evaluate in interface Evaluator<java.lang.Object,OutputType>input - The input (ignored).public OutputType getValue()
public void setValue(OutputType value)
value - The constant output value.public static <OutputType> ConstantEvaluator<OutputType> create(OutputType value)
ConstantEvaluator for the given value.OutputType - The output type for the evaluatorvalue - The constant to output.ConstantEvaluator that always returns the given value.