Vitamin C

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 TypesReturn TypeInterface
()voidRunnable
()TSupplier
()booleanBooleanSupplier
()intIntSupplier
()longLongSupplier
()doubleDoubleSupplier
(T)voidConsumer<T>
(T)TUnaryOperator<T>
(T)RFunction<T,R>
(T)booleanPredicate<T>
(T)intToIntFunction<T>
(T)longToLongFunction<T>
(T)doubleToDoubleFunction<T>
(T, T)TBinaryOperator<T>
(T, U)voidBiConsumer<T,U>
(T, U)RBiFunction<T,U,R>
(T, U)booleanBiPredicate<T,U>
(T, U)intToIntBiFunction<T,U>
(T, U)longToLongBiFunction<T,U>
(T, U)doubleToDoubleBiFunction<T,U>
(T, int)voidObjIntConsumer<T>
(T, long)voidObjLongConsumer<T>
(T, double)voidObjDoubleConsumer<T>
(int)voidIntConsumer
(int)RIntFunction<R>
(int)booleanIntPredicate
(int)intIntUnaryOperator
(int)longIntToLongFunction
(int)doubleIntToDoubleFunction
(int, int)intIntBinaryOperator
(long)voidLongConsumer
(long)RLongFunction<R>
(long)booleanLongPredicate
(long)intLongToIntFunction
(long)longLongUnaryOperator
(long)doubleLongToDoubleFunction
(long, long)longLongBinaryOperator
(double)voidDoubleConsumer
(double)RDoubleFunction<R>
(double)booleanDoublePredicate
(double)intDoubleToIntFunction
(double)longDoubleToLongFunction
(double)doubleDoubleUnaryOperator
(double, double)doubleDoubleBinaryOperator


Got any Java Language Question?