Created
April 10, 2020 17:00
-
-
Save Raouf25/e0c1af2b58a7a9a99b2d716f4cc7a710 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
private <T, R, E extends Exception> | |
Function<T, R> wrapper(FunctionWithException<T, R, E> fun) { | |
return arg -> { | |
try { | |
return fun.apply(arg); | |
} catch (Exception e) { | |
throw new RuntimeException(e); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment