Modifier and Type | Method and Description |
---|---|
static <R,T,V> Function<T,V> |
andThen(Function<? super T,? extends R> this_,
Function<? super R,? extends V> after)
Returns a composed function that first applies the
this_ function to
its input, and then applies the after function to the result. |
static <R,T,V> Function<V,R> |
compose(Function<? super T,? extends R> this_,
Function<? super V,? extends T> before)
Returns a composed function that first applies the
before
function to its input, and then applies the this_ function to the result. |
static <T> Function<T,T> |
identity()
Returns a function that always returns its input argument.
|
public static <R,T,V> Function<V,R> compose(Function<? super T,? extends R> this_, Function<? super V,? extends T> before)
before
function to its input, and then applies the this_
function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.R
- the type of the result of the this_
function and of the composed functionT
- the type of the input to the this_
and of the result of the before
functionV
- the type of input to the before
function, and to the
composed functionthis_
- the function to apply after the before
function is appliedbefore
- the function to apply before the this_
function is appliedbefore
function and then applies the this_
functionNullPointerException
- if this_
is nullNullPointerException
- if before is nullandThen(Function, Function)
public static <R,T,V> Function<T,V> andThen(Function<? super T,? extends R> this_, Function<? super R,? extends V> after)
this_
function to
its input, and then applies the after
function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.R
- the type of the result of the this_
function and of the input to the after
function.T
- the type of the input to the this_
function and to the composed functionV
- the type of output of the after
function, and of the
composed functionthis_
- the function to apply before the after
function is appliedafter
- the function to apply after the this_
function is appliedthis_
function and then
applies the after
functionNullPointerException
- if this_
is nullNullPointerException
- if after is nullcompose(Function, Function)
public static <T> Function<T,T> identity()
T
- the type of the input and output objects to the functionCopyright © 2018. All rights reserved.