Annotate functional interfaces
Interface | Method |
---|---|
Predicate<T> | boolean test(T thing)
|
Consumer<T> | void accept(T thing)
|
Supplier<T> | T get()
|
Function<T,R> | R apply(T thing)
|
UnaryOperator<T> | T apply(T thing)
|
BinayOperator<T> | T apply(T thing1, T thing2)
|
You should be familiar with the above core functional interfaces. Whenever you can use them, you probably should use them.