Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
@FunctionalInterface
public interface Function<T, R>
Known subtypesUnaryOperator
A function of one argument.
Type parameters
<T>- the input type
<R>- the result type
Methods
Method details
apply
public abstract R apply(T t)Applies this function.
Parameters
tT- the input
Returns
the result
compose
public default <V> Function<V, R> compose(Function<? super V, ? extends T> before)before, then this function on its result.Parameters
beforeFunction<? super V, ? extends T>- the function applied first
<V>- the input type of
before
Returns
the composed function
andThen
public default <V> Function<T, V> andThen(Function<? super R, ? extends V> after)This function, then
after on its result.Parameters
afterFunction<? super R, ? extends V>- the function applied next
<V>- the result type of
after
Returns
the composed function
identity
public static <T> Function<T, T> identity()The function that answers its argument.
Parameters
<T>- the type
Returns
the identity function