public final class Throwables
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <K extends java.lang.Throwable> |
throwIfInstance(java.lang.Throwable t,
java.lang.Class<K> clazz)
if (t instanceof K) throw (K)t;
|
static java.lang.RuntimeException |
throwUncheckedException(java.lang.Throwable ex)
If Throwable is a RuntimeException or Error, rethrow it.
|
public static java.lang.RuntimeException throwUncheckedException(java.lang.Throwable ex)
public static <K extends java.lang.Throwable> void throwIfInstance(java.lang.Throwable t, java.lang.Class<K> clazz) throws K extends java.lang.Throwable
Note: The runtime type of the thrown exception will be the same as t even if clazz is a supertype of t.
K extends java.lang.Throwable