commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita" <>
Subject [functor] Using [fucntor] functional interfaces with Java 8 lambdas
Date Fri, 21 Dec 2012 19:22:35 GMT
Hi all, 

Just wanted to let you guys know that I am successfully compiling and executing code using [functor] and
Java 8. And am also using [functor] functional interfaces with lambdas.

So instead of writing:

UnaryPredicate isEven = new UnaryPredicate() {
    public boolean test(Integer obj) {
        return obj % 2 == 0;

One can simply write:

UnaryPredicate isEven = (Integer obj) -> { return obj % 2 == 0; };

FWIW, Google Guava's Predicate [1] is not a functional interface, so it cannot be used with
lambdas, as in the example above.

I'll continue to experiment with [functor] and Java 8. There are only two open issues in Jira,
one regarding generators (there's a branch with a proposal implementation) and another one
about the equals() method in the [functor] API. 

I wrote a short blog post [2] about how I'm running Java 8 in Eclipse Juno, in case anyone
is interested in trying it too. The code is hosted at GitHub [3].


Bruno P. Kinoshita 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message