Created 10-18-2017 12:46 PM
I want to know if nifi 1.3.0 version contains groovy version in which i can use lambdas?.
Created 10-18-2017 01:02 PM
IIRC, Groovy 3 is supposed to support the Java lambda syntax, but NiFi uses Groovy 2 which does not support it. However Groovy has always had Closures, which are very similar and used for the same purpose, so despite a small difference in syntax, you should be able to use Groovy closures the same as you would use Java lambdas. If you are referring to the Java Streams API (things like foreach() that take a lambda), Groovy has iterative and aggregate functions for that too, such as each() and eachWithIndex(), spread-dot and collect(), etc.
Created 10-18-2017 01:02 PM
IIRC, Groovy 3 is supposed to support the Java lambda syntax, but NiFi uses Groovy 2 which does not support it. However Groovy has always had Closures, which are very similar and used for the same purpose, so despite a small difference in syntax, you should be able to use Groovy closures the same as you would use Java lambdas. If you are referring to the Java Streams API (things like foreach() that take a lambda), Groovy has iterative and aggregate functions for that too, such as each() and eachWithIndex(), spread-dot and collect(), etc.