Skip to main content

Konstantin Yovkov

 

kocko's blog

Java8: How to implement a custom Collector?

Posted by kocko on December 19, 2014 at 4:40 AM PST

As you may already know, Java's Stream API is one of the most significant features introduced in the latest platform version. Aside from the lambdas, which can reduce the amount of boilerplate code in our code base, the Stream API releases us from the burden to be responsible for how collections are traversed, for example.

How to tell Java to apply a lambda expressions for a custom functional interface instead for the one from the method's contract?

Posted by kocko on June 19, 2014 at 10:11 PM PDT

The lambdas are without any doubt one of the most intriguing and attractive features in Java8, but sometimes instead of helping us writting a better and boilerplateless code, they can get us into trouble. And still, they are the better alternative to the anonymous classes for lots of reasons.