Consumers¶
- public class org.apache.commons.lang3.function.Consumers[source]¶
Provides
Consumerinstances.- Since:
3.13.0
Methods¶
Applies the given |
|
Gets the NOP Consumer singleton. |
- public static <T> void accept(Consumer<T> consumer, T object)[source]¶
Applies the given
Consumeraction to the object if the consumer is notnull. Otherwise, does nothing.- Parameters:
consumer – The consumer to consume.
object – The object to be consumed.
- Type parameters:
<T> – the type of the argument the consumer accepts.
- Since:
3.15.0
- @SuppressWarnings({"unchecked"}) public static <T> Consumer<T> nop()[source]¶
Gets the NOP Consumer singleton.
- Type parameters:
<T> – type type to consume.
- Returns:
The NOP Consumer singleton.