-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Spring 5.0 Cookbook
By :

Some of the lambda expressions can be simplified using some valid short-hand forms, given that a certain method or keyword can satisfy the implementation of the concerned functional interfaces. Instead of writing the full-blown expressions with the parameters and curly braces, we intend to reduce lambda expression as much as possible to apply the principles of functional programming. This recipe will highlight how to optimize a lambda expression used in object instantiation and method calls.
Open the same project, ch06
, and let us implement service classes that utilize built-in functional interfaces using method and constructor references.
To illustrate the use of method and constructor references, follow these steps:
EmployeeDataService
, which will provide instances of empty Employee
instances and a zero-sized ArrayList
object for a list of employees. Also, it has a method that converts...