Search This Blog

Wednesday, 28 October 2015

Interfaces and Default Methods

In an earlier post, I covered one of Java 8's new features - default methods in interfaces. While I did the pros there were some corner cases to be considered when implementing this feature.

Tuesday, 20 October 2015

The BiVersions of Java FunctionalInterfaces

In the previous post, we saw a version of the Function class that took two parameters into apply instead of one. Similar to the BiFunction interface, we also have BiPredicate, BinaryOperator, and BiSupplier .

Wednesday, 7 October 2015

Variations in java functions

In the previous post, we saw the Function Interface that takes an object of one type and transforms it into an object of another type. Consider the user case where we need to split a string and retain only the second half.

Thursday, 24 September 2015

The Function Interface

I worked with using lambdas for Comparator interface in my first post on Lambdas. We saw how a Function interface could be used to convert an object of one type into an object of another.

Thursday, 3 September 2015

Predicates to determine the truth !

We have seen some of the functional interfaces like Consumer and Supplier in the earlier posts. The next one I wanted to explore is the Predicate interface. This one is used for testing certain conditions on a passed instance and returns a boolean value.