Top Description Fields Methods
org.apache.commons.lang3.function

public Interface FailableConsumer<T, E extends Throwable>

Annotations
@FunctionalInterface
Type Parameters
<T>
the type of the input to the operation
<E>
Thrown exception type.
Imports
java.util.Objects, java.util.function.Consumer, .Function

A functional interface like Consumer that declares a Throwable.

This is a functional interface whose functional method is accept(Object).

Since
3.11

Field Summary

Modifier and TypeField and Description
public static final FailableConsumer<T, E extends Throwable>
NOP

NOP singleton

Method Summary

Modifier and TypeMethod and Description
public void
accept(T
the parameter for the consumable to accept
object
)

Accepts the given arguments.

public default FailableConsumer<T, E>

Returns:

a composed Consumer like Consumer#andThen(Consumer).
andThen
(final FailableConsumer<? super T, E>
the operation to perform after this operation
after
)

Returns a composed Consumer like Consumer#andThen(Consumer).

public static <
Consumed type 1.
T
,
The kind of thrown exception or error.
E extends Throwable
>
FailableConsumer<T, E>

Returns:

The NOP singleton.
nop
()

Gets the NOP singleton.

Field Detail

NOPback to summary
public static final FailableConsumer<T, E extends Throwable> NOP

NOP singleton

Annotations
@SuppressWarnings:rawtypes

Method Detail

acceptback to summary
public void accept(T object) throws E

Accepts the given arguments.

Parameters
object:T

the parameter for the consumable to accept

Exceptions
E:
Thrown when the consumer fails.
andThenback to summary
public default FailableConsumer<T, E> andThen(final FailableConsumer<? super T, E> after)

Returns a composed Consumer like Consumer#andThen(Consumer).

Parameters
after:FailableConsumer<? super T, E>

the operation to perform after this operation

Returns:FailableConsumer<T, E>

a composed Consumer like Consumer#andThen(Consumer).

Exceptions
NullPointerException:
when after is null
nopback to summary
public static <T, E extends Throwable> FailableConsumer<T, E> nop()

Gets the NOP singleton.

Parameters
<T>
Consumed type 1.
<E>
The kind of thrown exception or error.
Returns:FailableConsumer<T, E>

The NOP singleton.

Annotations
@SuppressWarnings:unchecked