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

org.whaka.util.function.Consumer2 Maven / Gradle / Ivy

package org.whaka.util.function;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

/**
 * Equal to {@link BiConsumer}.
 * 
 * @see #toConsumer(Consumer2)
 */
@FunctionalInterface
public interface Consumer2 extends BiConsumer {

	@Override
	void accept(A a, B b);

	/**
	 * Converts specified consumer into a {@link Consumer} were all arguments are represented
	 * as a single {@link Tuple2} instance.
	 */
	static  Consumer> toConsumer(Consumer2 delegate) {
		return e -> delegate.accept(e._1, e._2);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy