Created
September 22, 2016 14:42
-
-
Save nwillc/6ddc7eb4ce0a73662e3efeabca85ca6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FunctionalInterface | |
public interface ThrowingBiFunction<T, U, R> extends BiFunction<T, U, R> { | |
@Override | |
default R apply(T t, U u) { | |
try { | |
return applyThrows(t, u); | |
} catch (Exception e) { | |
throw new RuntimeException(e); | |
} | |
} | |
R applyThrows(T t, U u) throws Exception; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment