Class FunctionExpression<S>

java.lang.Object
org.springframework.integration.expression.FunctionExpression<S>
Type Parameters:
S - The evaluation context root object type.
All Implemented Interfaces:
Expression

public class FunctionExpression<S> extends Object implements Expression
An Expression that simply invokes Function.apply(Object) on its provided Function.

This is a powerful alternative to the SpEL, when Java 8 and its Lambda support is in use.

If the target component has support for an Expression property, a FunctionExpression can be specified instead of a SpelExpression as an alternative to evaluate the value from the Lambda, rather than runtime SpEL resolution.

The FunctionExpression is 'read-only', hence only getValue() operations are allowed. Any setValue(org.springframework.expression.EvaluationContext, java.lang.Object) operations and getValueType() related operations throw EvaluationException.

Since:
5.0
Author:
Artem Bilan, Gary Russell