Cheatography
https://cheatography.com
Java Stream API functional Interaface
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Java Functional Interface
Consumer<T> |
void accept(T t) |
Function<T,R> |
R apply(T t) |
Supplier<T> |
T get() |
UnaryOperator<T> |
T apply(T t) |
Predicate<T> |
boolean test(T t) |
|
|
Boolean Supplier Functional Interface
BooleanSupplier |
boolean getAsBoolean()
|
|
|
Primitive Functional Interface (integer)
IntConsumer |
void accept(int value) |
IntFunction<R> |
R apply(int value) |
IntSupplier |
int getAsInt() |
IntUnaryOperator |
int applyAsInt(int operand) |
IntPredicate |
boolean test(int value) |
IntBinaryOperator |
int applyAsInt(int left, int right) |
|
|
Object & Primitive Functional Interface
ObjDoubleConsumer<T> |
void accept(T t, double value) |
ObjIntConsumer<T> |
void accept(T t, int value) |
ObjLongConsumer<T> |
void accept(T t, long value) |
|
|
Primitive Functional Interface (double)
DoubleConsumer |
void accept(double value) |
DoubleFunction<R> |
R apply(double value) |
DoubleSupplier |
double getAsDouble() |
DoubleUnaryOperator |
double applyAsDouble(double operand) |
DoublePredicate |
boolean test(double value) |
DoubleBinaryOperator |
double applyAsDouble(double left, double right) |
|
|
|
|
To Primitive Functional Interface
ToDoubleBiFunction<T,U> |
double applyAsDouble(T t, U u) |
ToDoubleFunction<T> |
double applyAsDouble(T value) |
ToIntBiFunction<T,U> |
int applyAsInt(T t, U u) |
ToIntFunction<T> |
int applyAsInt(T value) |
ToLongBiFunction<T,U> |
long applyAsLong(T t, U u) |
ToLongFunction<T> |
long applyAsLong(T value) |
|
|
Java Functional Interface (Bi**)
BiConsumer<T,U> |
void accept(T t, U u) |
BinaryOperator<T> |
T apply(T t, T u) |
BiFunction<T,U,R> |
R apply(T t, U u) |
BiPredicate<T,U> |
boolean test(T t, U u) |
|
|
Primitive to primate Functional Interface
DoubleToIntFunction |
int applyAsInt(double value) |
DoubleToLongFunction |
long applyAsLong(double value) |
IntToDoubleFunction |
double applyAsDouble(int value) |
IntToLongFunction |
long applyAsLong(int value) |
LongToDoubleFunction |
double applyAsDouble(long value) |
LongToIntFunction |
int applyAsInt(long value) |
|
|
Primitive Functional Interface (long)
LongConsumer |
void accept(long value) |
LongFunction<R> |
R apply(long value) |
LongSupplier |
long getAsLong() |
LongUnaryOperator |
long applyAsLong(long operand) |
LongPredicate |
boolean test(long value) |
LongBinaryOperator |
long applyAsLong(long left, long right) |
|
|
|