Prefer standard functional interfaces
For many cases, instead of defining your own functional interfaces, you can use the
standard functional interfaces
defined by the JDK:
There are a large number of standard functional interfaces.
They're generic, so they can handle any type.
The 6 most commonly-used ones likely cover the majority of cases:
- with repeated use, they become familiar to maintainers, and act as a quick way of communicating behavior
- they often include useful default methods
You should be familiar with the above core functional interfaces.
Whenever you can use them, you probably should use them.
See Also :