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

org.codefilarete.tool.function.ThrowingBiFunction Maven / Gradle / Ivy

package org.codefilarete.tool.function;

import java.util.Objects;
import java.util.function.Function;

/**
 * @author Guillaume Mary
 */
@FunctionalInterface
public interface ThrowingBiFunction {
	
	/**
	 * Applies this function to the given argument.
	 *
	 * @param t the function argument
	 * @param u the second function argument
	 * @return the function result
	 */
	R apply(T t, U u) throws E;
	
	default  ThrowingBiFunction andThen(Function after) {
		Objects.requireNonNull(after);
		return (T t, U u) -> after.apply(apply(t, u));
	}
	
	default  ThrowingBiFunction andThen(ThrowingFunction after) {
		Objects.requireNonNull(after);
		return (T t, U u) -> after.apply(apply(t, u));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy