0% found this document useful (0 votes)
8 views1 page

java_functional_interfaces

java_functional_interfaces

Uploaded by

edelisakson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

java_functional_interfaces

java_functional_interfaces

Uploaded by

edelisakson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Functional Interfaces Cheat Sheet (package: java.util.

function)
Provide target types for lambda expressions and method references.

Primitive Type Prefixes

For: Predicate, Function, Consumer, UnaryOperator and BinaryOperator


Interfaces Arguments Return
When accepts primitive arguments (int, double, long) the interface is prefixed with Int,
Predicate<T> T Double, Long, e.g., LongConsumer, IntFunction, DoubleBinaryOperator.
boolean
BiPredicate<T, U> T, U
For: Supplier
Function<T, R> T
R The only interface that returns boolean primitive, apart from predicate, is
BiFunction<T, U, R> T, U BooleanSupplier.

Supplier<T> − T
For BiConsumer
Consumer<T> T Variants that accept an object and a primitive: ObjDoubleConsumer, ObjIntConsumer,
− ObjLongConsumer.
BiConsumer<T, U> T, U

For: Function and BiFunction


Special Interfaces Arguments Return When returns a primitive (int, double, long) it is prefixed with ToInt, ToDouble, ToLong,
e.g., ToIntFunction, ToDoubleBiFunction.
UnaryOperator<T> T
T
BinaryOperator<T> T, T For: Function
When accepts a primitive and returns another primitive, both prefixes are joined,
e.g., IntToDoubleFunction, LongToIntFunction.

www.theagilecrafter.com @AgileCrafter

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy