![JAR search and dependency download from the Maven repository](/logo.png)
co.pragmati.function.unchecked.UncheckedBiFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of func-commons Show documentation
Show all versions of func-commons Show documentation
Java 8 common library with extended functions
The newest version!
package co.pragmati.function.unchecked;
import java.util.Objects;
import java.util.function.Function;
/**
* BiFunction that throws exceptions
* @param
* @param
* @param
*
* @author jmbataller
*/
@FunctionalInterface
public interface UncheckedBiFunction {
R applyThows(T t, U u) throws Exception;
default R apply(T t, U u) {
try {
return applyThows(t, u);
} catch (RuntimeException e) {
throw e;
} catch (java.lang.Exception e) {
throw new RuntimeException(e);
}
}
default UncheckedBiFunction andThen(Function super R, ? extends V> after) {
Objects.requireNonNull(after);
return (T t, U u) -> after.apply(applyThows(t, u));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy