O'Reilly logo

Learning Java Functional Programming by Richard M Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

Method composition provides a flexible way of combining two or more functions into a single function. This offers flexibility that will otherwise not be present. We illustrate how this technique can be implemented using the Function interface. Its compose and andThen methods support the execution of functions before or after another function. We also demonstrated the usefulness of this technique by passing the composite functions to other methods allowing it be executed when needed.

Fluent interfaces are common in functional programming languages. We discussed the difference between this type of interface and the chaining and cascading techniques. While similar, chaining methods do not necessarily return the same object each time. Cascading ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required