Each of the following interfaces is annotated with @FunctionalInterface
|
Signature |
Interface |
Method |
|---|---|---|
|
() → void |
void run() | |
|
() → T |
T call() throws Exception | |
|
() → T |
Supplier |
T get() |
|
() → int |
IntSupplier |
int getAsInt() |
|
T → void |
Consumer |
void accept(T t) |
|
int → void |
IntConsumer |
void accept(int i) |
|
T → R |
R apply(T t) | |
|
T → boolean |
Predicate |
boolean test(T t) |
|
int → R |
IntFunction |
R apply(int i) |
|
T → int |
ToIntFunction |
int applyAsInt(T t) |
Method Reference
The operator :: allows referencing an existing method (static or not)
|
:: on type |
|
|---|---|
|
:: on instance |
|