
org.whaka.util.function.Function2 Maven / Gradle / Ivy
package org.whaka.util.function;
import java.util.function.BiFunction;
import java.util.function.Function;
/**
* Equal to {@link BiFunction}.
*
* @see #toFunction(Function2)
*/
@FunctionalInterface
public interface Function2 extends BiFunction {
@Override
R apply(A a, B b);
/**
* Convert specified function to the {@link Function} were all arguments are represented
* as a single {@link Tuple2} instance.
*/
static Function, R> toFunction(Function2 delegate) {
return e -> delegate.apply(e._1, e._2);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy