See: Description
| Interface | Description |
|---|---|
| Function0<R> |
Represents a function that accepts no arguments and produces a result.
|
| Function1<T1,R> |
Represents a function that accepts one argument and produces a result.
|
| Function2<T1,T2,R> |
Represents a function that accepts two arguments and produces a result.
|
| FunctionN<R> |
Represents a function that accepts
n arguments and produces a result. |
| Class | Description |
|---|---|
| FunctionN.Instance<R> |
An instance of
FunctionN which properly defines the
arity of that particular function. |
| Exception | Description |
|---|---|
| FunctionN.FunctionSizeException |
A
RuntimeException that is thrown whenever the size of
the arguments of a function is not equal to its arity. |
// Assignment Context
Function1<String, byte[]> f = String::getBytes;
// Method Invocation Context
byteToIntFunction.andThen(r -> r < 30);
// Cast Context
byteToIntFunction.andThen(((IntFunction1<Boolean>) r -> r < 30).boxInput());
The interfaces in this package are supposed to represent the core of all functions as all functional interfaces in this package are connected. They are meant to take partial points of existing functions and generalize them such that they can be referenced separately from the actual interface itself.
The interfaces in this package that are annotated with FunctionalInterface
are meant as merely an aid to capture design intent and enlist the help of the compiler
in identifying accidental violations of design intent. The interfaces in this package
that are annotated with InheritOnly are meant as an aid to capture that
the interface should only be inherited and never used directly as a functional interface.
This package holds all basic Functions (from some input(s) T1, T2, ... to some output R).
Some functional interfaces are specialized such that the type parameters are
primitives with additional type prefixes. For those that return a primitive value,
the interface is prefixed with ToX where X is the primitive type.
These schemes can be combined, as in ByteToLongFunction1.