T
- the type of the input to the apply
operationR
- the type of the result of the apply
operation@FunctionalInterface public interface Function<T,R>
Modifier and Type | Method and Description |
---|---|
default <V> Function<T,V> |
andThen(Function<? super R,? extends V> after)
Returns a new function which applies this function followed by the
provided function.
|
R |
apply(T t)
Compute the result of applying the function to the input argument
|
default <V> Function<V,R> |
compose(Function<? super V,? extends T> before)
Returns a new function which applies the provided function followed by
this function.
|
static <T> Function<T,T> |
identity()
Returns a
Function whose apply method returns its input. |
R apply(T t)
t
- the input objectdefault <V> Function<V,R> compose(Function<? super V,? extends T> before)
V
- type of input objects to the combined function. May be the
same type as <T>
or <R>
before
- an additional function to be applied before this function
is appliedNullPointerException
- if before is nulldefault <V> Function<T,V> andThen(Function<? super R,? extends V> after)
V
- type of output objects to the combined function. May be the
same type as <T>
or <R>
after
- an additional function to be applied after this function is
appliedNullPointerException
- if after is nullstatic <T> Function<T,T> identity()
Function
whose apply
method returns its input.T
- the type of the input and output objects to the function Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT ea-b96