| Modifier and Type | Method and Description |
|---|---|
static String |
currentStackTrace()
Returns the current stack trace of the calling thread.
|
static <T extends Throwable> |
wrapAs(Class<T> clazz,
Throwable t)
If
t if an instance of clazz, then t is
returned. |
static RuntimeException |
wrapAsRuntimeException(Throwable t)
Calls
wrapAs(Class, Throwable) with the first parameter set to
RuntimeException. |
public static <T extends Throwable> T wrapAs(Class<T> clazz, Throwable t)
t if an instance of clazz, then t is
returned. Otherwise an instance of clazz is created using a
single-parameter constructor accepting t and the wrapper exception
instance is returned. If no matching constructor can be found, a
RuntimeException is returned.clazz - The exception class to return (or wrap) t.t - Throwable instance to wrap.public static RuntimeException wrapAsRuntimeException(Throwable t)
wrapAs(Class, Throwable) with the first parameter set to
RuntimeException.public static String currentStackTrace()