Class SneakyThrower
java.lang.Object
ru.progrm_jarvis.javacommons.util.SneakyThrower
Utility used for rethrowing checked exceptions as unchecked.
-
Method Summary
Modifier and TypeMethodDescriptionsneakyThrow(X exception) Rethrows the provided throwable without the need to handle it.
-
Method Details
-
sneakyThrow
Rethrows the provided throwable without the need to handle it. This always throwsXnever returning any value.- Type Parameters:
X- type of the returned exceptionR- any formal return type of this expression- Parameters:
exception- rethrown exception- Returns:
- never
-