Lambda Functions

You can use lambda functions in the Expression Language.

See Also
Expression Language Principles
Variables
Input Parameters
Expression Operators
Functions

The general syntax of a lambda function is:

(parameterName1:parameterType1, parameterName2:parameterType2, ...) => expression

When there is only one parameter, you can omit the parentheses. When the Expression Language can infer the data type, you can omit the parameter type too.

Examples:

foo => foo + 2
(foo:Integer, bar:Integer) => (foo * bar)
(foo:Integer, bar) => foo + bar

You can use a lambda function as a parameter of a function. The parameter type must be Function. For more information, see Types.

values : List<String> = ["foo", "bar"];
values.anyMatch(value => value == "bar")