Java8中的常见函数式接口

Java8 中的常用函数式接口

内容来自于《Java8实战》

函数式接口函数描述符原始类型特化
PredicateT->booleanIntPredicate, LongPredicate, DoublePredicate
ConsumerT->voidIntConsumer, LongConsumer, DoubleConsumer
Function<T, R>T->RIntFunction,
IntToDoubleFunction,
IntToLongFunction,
LongFunction,,
LongToDoubleFunction,
LongToIntFunction,
DoubleFunction,
ToIntFunction,
ToDoubleFunction,
ToLongFunction
Supplier()->TBooleanSupplier, IntSupplier, LongSupplier, DoubleSupplier
UnaryOperatorT->TIntUnaryOperator, LongUnaryOperator, DoubleUnaryOperator
BinaryOperator(T, T)->TIntBinaryOperator, LongBinaryOperator, DoubleBinaryOperator
BiPredicate<L, R>(L, R)->boolean
BiConsumer<T, U>(T, U)->voidObjIntConsumer,
ObjLongConsumer,
ObjDoubleConsumer
BiFunction<T, U, R>(T, U)->RToIntBiFunction<T, U>,
ToLongBiFunction<T, U>,
ToDoubleBiFunction<T, U>

版权声明:本文为Albert_1000原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。