Java Language

Functional Interfaces

Introduction#

In Java 8+, a functional interface is an interface that has just one abstract method (aside from the methods of Object). See JLS ยง9.8. Functional Interfaces.

List of standard Java Runtime Library functional interfaces by signature

Parameter Types Return Type Interface
() void Runnable
() T Supplier
() boolean BooleanSupplier
() int IntSupplier
() long LongSupplier
() double DoubleSupplier
(T) void Consumer<T>
(T) T UnaryOperator<T>
(T) R Function<T,R>
(T) boolean Predicate<T>
(T) int ToIntFunction<T>
(T) long ToLongFunction<T>
(T) double ToDoubleFunction<T>
(T, T) T BinaryOperator<T>
(T, U) void BiConsumer<T,U>
(T, U) R BiFunction<T,U,R>
(T, U) boolean BiPredicate<T,U>
(T, U) int ToIntBiFunction<T,U>
(T, U) long ToLongBiFunction<T,U>
(T, U) double ToDoubleBiFunction<T,U>
(T, int) void ObjIntConsumer<T>
(T, long) void ObjLongConsumer<T>
(T, double) void ObjDoubleConsumer<T>
(int) void IntConsumer
(int) R IntFunction<R>
(int) boolean IntPredicate
(int) int IntUnaryOperator
(int) long IntToLongFunction
(int) double IntToDoubleFunction
(int, int) int IntBinaryOperator
(long) void LongConsumer
(long) R LongFunction<R>
(long) boolean LongPredicate
(long) int LongToIntFunction
(long) long LongUnaryOperator
(long) double LongToDoubleFunction
(long, long) long LongBinaryOperator
(double) void DoubleConsumer
(double) R DoubleFunction<R>
(double) boolean DoublePredicate
(double) int DoubleToIntFunction
(double) long DoubleToLongFunction
(double) double DoubleUnaryOperator
(double, double) double DoubleBinaryOperator

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow