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

net.openhft.chronicle.testframework.internal.function.VanillaNamedConsumer Maven / Gradle / Ivy

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

import net.openhft.chronicle.testframework.function.NamedConsumer;

import java.util.function.Consumer;

import static java.util.Objects.requireNonNull;

public final class VanillaNamedConsumer implements NamedConsumer {

    private final Consumer consumer;
    private final String name;

    public VanillaNamedConsumer(final Consumer consumer,
                                final String name) {
        this.consumer = requireNonNull(consumer);
        this.name = requireNonNull(name);
    }

    @Override
    public void accept(T t) {
        consumer.accept(t);
    }

    @Override
    public String name() {
        return name;
    }

    @Override
    public String toString() {
        return name;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy