public static class IndexedConsumer.Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> IndexedConsumer<T> |
accept(IntConsumer c1,
Consumer<? super T> c2)
Returns an
IndexedConsumer that accepts IntConsumer
for index and Consumer for object. |
static <T> IndexedConsumer<T> |
wrap(Consumer<? super T> consumer)
Wraps a
Consumer and returns IndexedConsumer. |
public static <T> IndexedConsumer<T> wrap(Consumer<? super T> consumer)
Consumer and returns IndexedConsumer.T - the type of the input argumentconsumer - the consumer to wrapIndexedConsumerNullPointerException - if consumer is nullpublic static <T> IndexedConsumer<T> accept(IntConsumer c1, Consumer<? super T> c2)
IndexedConsumer that accepts IntConsumer
for index and Consumer for object.
if (c1 != null)
c1.accept(index);
if (c2 != null)
c2.accept(object);
T - the type of the inputc1 - the IntConsumer for index, can be nullc2 - the Consumer for object, can be nullIndexedConsumerCopyright © 2018. All rights reserved.