Show Menu
Cheatography

Stream API (Functional Interface) Cheat Sheet (DRAFT) by

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

Consum­er<­T>
void accept(T t)
Functi­on<­T,R>
R apply(T t)
Suppli­er<­T>
T get()
UnaryO­per­ato­r<T>
T apply(T t)
Predic­ate­<T>
boolean test(T t)
 


Boolean Supplier Functional Interface

Boolea­nSu­pplier
boolean getAsB­oolean()
 


Primitive Functional Interface (integer)

IntCon­sumer
void accept(int value)
IntFun­cti­on<­R>
R apply(int value)
IntSup­plier
int getAsInt()
IntUna­ryO­perator
int applyAsInt(int operand)
IntPre­dicate
boolean test(int value)
IntBin­ary­Ope­rator
int applyAsInt(int left, int right)
 


Object & Primitive Functional Interface

ObjDou­ble­Con­sum­er<­T>
void accept(T t, double value)
ObjInt­Con­sum­er<­T>
void accept(T t, int value)
ObjLon­gCo­nsu­mer­<T>
void accept(T t, long value)
 


Primitive Functional Interface (double)

Double­Con­sumer
void accept(double value)
Double­Fun­cti­on<­R>
R apply(double value)
Double­Sup­plier
double getAsD­ouble()
Double­Una­ryO­perator
double applyA­sDouble(double operand)
Double­Pre­dicate
boolean test(double value)
Double­Bin­ary­Ope­rator
double applyA­sDouble(double left, double right)
 


 

To Primitive Functional Interface

ToDoub­leB­iFu­nct­ion­<T,­U>
double applyA­sDouble(T t, U u)
ToDoub­leF­unc­tio­n<T>
double applyA­sDouble(T value)
ToIntB­iFu­nct­ion­<T,­U>
int applyAsInt(T t, U u)
ToIntF­unc­tio­n<T>
int applyAsInt(T value)
ToLong­BiF­unc­tio­n<T­,U>
long applyA­sLong(T t, U u)
ToLong­Fun­cti­on<­T>
long applyA­sLong(T value)
 


Java Functional Interface (Bi**)

BiCons­ume­r<T­,U>
void accept(T t, U u)
Binary­Ope­rat­or<­T>
T apply(T t, T u)
BiFunc­tio­n<T­,U,­R>
R apply(T t, U u)
BiPred­ica­te<­T,U>
boolean test(T t, U u)
 


Primitive to primate Functional Interface

Double­ToI­ntF­unction
int applyAsInt(double value)
Double­ToL­ong­Fun­ction
long applyA­sLong(double value)
IntToD­oub­leF­unction
double applyA­sDouble(int value)
IntToL­ong­Fun­ction
long applyA­sLong(int value)
LongTo­Dou­ble­Fun­ction
double applyA­sDouble(long value)
LongTo­Int­Fun­ction
int applyAsInt(long value)
 


Primitive Functional Interface (long)

LongCo­nsumer
void accept(long value)
LongFu­nct­ion­<R>
R apply(long value)
LongSu­pplier
long getAsLong()
LongUn­ary­Ope­rator
long applyA­sLong(long operand)
LongPr­edicate
boolean test(long value)
LongBi­nar­yOp­erator
long applyA­sLong(long left, long right)