buckelieg.fn.db.TryBiFunction Maven / Gradle / Ivy
package buckelieg.fn.db;
import static java.util.Objects.requireNonNull;
/**
* Two-argument function with returned result that throws an exception
*
* @param first input argument type
* @param second input argument type
* @param result type
* @param an exception type thrown
*/
@FunctionalInterface
public interface TryBiFunction {
/**
* Returns reference of lambda expression.
*
* @param tryBiFunction a function
* @return lambda as {@link TryBiFunction} reference
* @throws NullPointerException if tryBiFunction is null
*/
static TryBiFunction of(TryBiFunction tryBiFunction) {
return requireNonNull(tryBiFunction);
}
/**
* Represents some two-argument function which might throw an Exception
*
* @param input1 first argument
* @param input2 second argument
* @return output
* @throws E an exception
*/
O apply(I1 input1, I2 input2) throws E;
}