All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.openhft.chronicle.testframework.function.NamedConsumer Maven / Gradle / Ivy

There is a newer version: 2.27ea0
Show newest version
package net.openhft.chronicle.testframework.function;

import net.openhft.chronicle.testframework.internal.VanillaNamedConsumer;

import java.util.function.Consumer;

import static java.util.Objects.requireNonNull;

public interface NamedConsumer extends HasName, Consumer {

    static  NamedConsumer of(final Consumer consumer,
                                   final String name) {
        requireNonNull(consumer);
        requireNonNull(name);
        return new VanillaNamedConsumer<>(consumer, name);
    }

    static  NamedConsumer ofThrowing(final ThrowingConsumer consumer,
                                           final String name) {
        return of(ThrowingConsumer.of(consumer), name);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy