Top Description Methods
org.apache.sshd.common.util.io.functors

public Interface IOFunction<T, R>

Annotations
@FunctionalInterface
Type Parameters
<T>
Type of input
<R>
Type of output
Imports
java.io.IOException, java.util.Objects

Invokes some I/O function on the input returning some output and potentially throwing an IOException in the process
Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public default <
the type of output of the after function, and of the composed function
V
>
IOFunction<T, V>

Returns:

a composed function that first applies this function and then applies the after function
andThen
(IOFunction<? super R, ? extends V>
the function to apply after this function is applied
after
)

Returns a composed function that first applies this function to its input, and then applies the after function to the result.

public R
apply(T t)

public default <
the type of input to the before function, and to the composed function
V
>
IOFunction<V, R>

Returns:

a composed function that first applies the before function and then applies this function
compose
(IOFunction<? super V, ? extends T>
the function to apply before this function is applied
before
)

Returns a composed function that first applies the before function to its input, and then applies this function to the result.

public static <
the type of the input and output objects to the function
T
>
IOFunction<T, T>

Returns:

a function that always returns its input argument
identity
()

Returns a function that always returns its input argument.

Method Detail

andThenback to summary
public default <V> IOFunction<T, V> andThen(IOFunction<? super R, ? extends V> after)

Returns a composed function that first applies 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.

Parameters
<V>
the type of output of the after function, and of the composed function
after:IOFunction<? super R, ? extends V>

the function to apply after this function is applied

Returns:IOFunction<T, V>

a composed function that first applies this function and then applies the after function

Exceptions
NullPointerException:
if after is null
See Also
compose(IOFunction)
applyback to summary
public R apply(T t) throws IOException
composeback to summary
public default <V> IOFunction<V, R> compose(IOFunction<? super V, ? extends T> before)

Returns a composed function that first applies the before function to its input, and then applies this function to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.

Parameters
<V>
the type of input to the before function, and to the composed function
before:IOFunction<? super V, ? extends T>

the function to apply before this function is applied

Returns:IOFunction<V, R>

a composed function that first applies the before function and then applies this function

Exceptions
NullPointerException:
if before is null
See Also
andThen(IOFunction)
identityback to summary
public static <T> IOFunction<T, T> identity()

Returns a function that always returns its input argument.

Parameters
<T>
the type of the input and output objects to the function
Returns:IOFunction<T, T>

a function that always returns its input argument