There is a list of all interfaces being annotated with @FunctionalInterface
available in the API documentation, when you browse to the FunctionalInterface
’s class documentation and click on the USE link at the top.
But it must be emphasized that the presence of the annotation is not mandatory to make an interface
a functional interface. Each interface having exactly one abstract
method not matching a public
method of java.lang.Object
can be implemented via lambda expressions or method references, though that doesn’t necessarily implies that the result will fulfill the additional contracts specified for the particular interface
.
There are roughly 200 interfaces in the JRE fulfilling the technical constraints, so the compiler wouldn’t object when you try to implement them via lambda expression. Only a few of them have the annotation. Some of those not having the annotation will still work smoothly, e.g. ActionListener
, InvocationHandler
, or ThreadFactory
, whereas others are unsuitable due to additional constraints like Comparable
, ProtocolFamily
, FlavorException
. This is also discussed in “Why isn't @FunctionalInterface used on all the interfaces in the JDK that qualify?”
So while @FunctionalInterface
documents the intention of being usable as target type of a lambda expression or method reference, other interface types may still be suitable for the same purpose, but you have to investigate the contracts yourself to conclude whether the use is appropriate.