java8中的常用函数式接口

iBit程序猿 2020年05月28日 982次浏览
函数式接口表达式拓展备注
PredicateT -> booleanDoublePredicate
IntPredicate
LongPredicate
谓词
ConsumerT -> voidDoubleConsumer
IntConsumer
LongConsumer
消费
Function<T, R>T -> RDoubleFunction<R>
DoubleToIntFunction
DoubleToLongFunction
IntFunction<R>
IntToDoubleFunction
IntToLongFunction
LongFunction<R>
LongToDoubleFunction
LongToIntFunction
ToDoubleFunction<T>
ToIntFunction<T>
ToLongFunction<T>
类型转换
Supplier() -> TBooleanSupplier
DoubleSupplier
IntSupplier
LongSupplier
生产
UnaryOperatorT -> TIntUnaryOperator
LongUnaryOperator
一元运算符
BinaryOperator(T, T) -> TDoubleBinaryOperator
IntBinaryOperator
LongBinaryOperator
二元运算符
BiPredicate<T, U>(T, U) -> boolean 扩展Predicate
BiConsumer<T, U>(T, U) -> voidObjDoubleConsumer<T>
ObjIntConsumer<T>
ObjLongConsumer<T>
扩展Consumer
BiFunction<T, U, R>(T, U) -> RToDoubleBiFunction<T, U>
ToIntBiFunction<T, U>
ToLongBiFunction<T, U>
扩展Function