| Modifier and Type | Method and Description |
|---|---|
static <T> void |
accept(Consumer<T> consumer,
T object)
Applies the given
Consumer action to the object if the consumer is not null. |
static <T> Consumer<T> |
nop()
Gets the NOP Consumer singleton.
|
public static <T> void accept(Consumer<T> consumer, T object)
Consumer action to the object if the consumer is not null. Otherwise, does nothing.T - the type of the argument the consumer accepts.consumer - the consumer to consume.object - the object to be consumed.public static <T> Consumer<T> nop()
T - type type to consume.Copyright © 2001–2025 The Apache Software Foundation. All rights reserved.