public final class JkUtilsThrowable
extends java.lang.Object
Throwable
Modifier and Type | Class and Description |
---|---|
static interface |
JkUtilsThrowable.ThrowingConsumer<T,E extends java.lang.Throwable> |
Modifier and Type | Method and Description |
---|---|
static boolean |
isInCause(java.lang.Throwable throwable,
java.lang.Class<? extends java.lang.Throwable> causeClass)
Returns
true if the specified throwable has the specified cause exception class
in its chain. |
static boolean |
nestedContains(java.lang.Throwable throwable,
java.lang.Class<java.lang.Exception> exceptionClass,
java.lang.String message)
Returns
true if the specified throwable has the specified cause exception class
along the specified message in its chain. |
static void |
printStackTrace(java.io.PrintStream printStream,
java.lang.StackTraceElement[] stack,
int maxElement) |
static void |
printStackTrace(java.io.PrintStream printStream,
java.lang.Throwable e,
int maxElement) |
static java.lang.RuntimeException |
unchecked(java.lang.Exception e)
Returns the specified exception itself if it is an unchecked exception
(extending
RuntimeException ). |
static java.lang.RuntimeException |
unchecked(java.lang.Throwable e,
java.lang.String message)
Same as
unchecked(Exception) but specifying an error message. |
public static java.lang.RuntimeException unchecked(java.lang.Exception e)
RuntimeException
). Otherwise, returns a new
RuntimeException
wrapping the exception passed as argument.public static java.lang.RuntimeException unchecked(java.lang.Throwable e, java.lang.String message)
unchecked(Exception)
but specifying an error message.public static boolean nestedContains(java.lang.Throwable throwable, java.lang.Class<java.lang.Exception> exceptionClass, java.lang.String message)
true
if the specified throwable has the specified cause exception class
along the specified message in its chain.public static boolean isInCause(java.lang.Throwable throwable, java.lang.Class<? extends java.lang.Throwable> causeClass)
true
if the specified throwable has the specified cause exception class
in its chain.public static void printStackTrace(java.io.PrintStream printStream, java.lang.StackTraceElement[] stack, int maxElement)
public static void printStackTrace(java.io.PrintStream printStream, java.lang.Throwable e, int maxElement)