public class Consumers<T>
extends java.lang.Object
implements java.util.function.Consumer<T>
Constructor and Description |
---|
Consumers(java.util.function.Consumer<T>... consumers) |
Consumers(java.lang.Iterable<Consumers<T>> consumers) |
Modifier and Type | Method and Description |
---|---|
void |
accept(T t)
Consumes all registered consumers.
|
Consumers<T> |
add(java.util.function.Consumer<T> consumer)
Registers an additional consumer.
|
Consumers<T> |
addAll(java.util.function.Consumer<T>... consumers)
Registers additional consumers.
|
java.util.function.Consumer |
clear()
Clears the list of consumers.
|
static <R> Consumers<R> |
empty() |
boolean |
isEmpty() |
static <R> Consumers<R> |
of(java.util.function.Consumer<R>... consumers)
Creates an aggregate from given consumers.
|
static <R> Consumers<R> |
of(java.lang.Iterable<java.util.function.Consumer<R>> consumers) |
Consumers<T> |
parallel(boolean parallel)
Defines if consumer acceptance should be parallel.
|
Consumers<T> |
remove(java.util.function.Consumer<T> consumer)
Removes a consumer.
|
public Consumers(java.util.function.Consumer<T>... consumers)
public static <R> Consumers<R> empty()
public static <R> Consumers<R> of(java.util.function.Consumer<R>... consumers)
public static <R> Consumers<R> of(java.lang.Iterable<java.util.function.Consumer<R>> consumers)
public Consumers<T> add(java.util.function.Consumer<T> consumer)
public Consumers<T> addAll(java.util.function.Consumer<T>... consumers)
public Consumers<T> parallel(boolean parallel)
public void accept(T t)
parallel(boolean)
flag is set, consumption is going to be parallel.accept
in interface java.util.function.Consumer<T>
public boolean isEmpty()
public java.util.function.Consumer clear()
Copyright © 2003-present Jodd Team