public final class Throwables extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addSuppressed(Throwable throwable,
Throwable suppressedThrowable)
Deprecated.
If compiling on Java 7 and above use
Throwable.addSuppressed(Throwable) . Marked as deprecated because Java 6 is
deprecated. |
static Throwable[] |
getSuppressed(Throwable throwable)
Deprecated.
If compiling on Java 7 and above use
Throwable.getSuppressed() . Marked as deprecated because Java 6 is
deprecated. |
static boolean |
isGetSuppressedAvailable()
Returns true if the getSuppressed method is available.
|
static void |
rethrow(Throwable t)
Rethrows a
Throwable , wrapping checked exceptions into an UndeclaredThrowableException . |
static List<String> |
toStringList(Throwable throwable)
Converts a Throwable stack trace into a List of Strings
|
@Deprecated public static void addSuppressed(Throwable throwable, Throwable suppressedThrowable)
Throwable.addSuppressed(Throwable)
. Marked as deprecated because Java 6 is
deprecated.throwable
- a ThrowablesuppressedThrowable
- a suppressed ThrowableThrowable.addSuppressed(Throwable)
@Deprecated public static Throwable[] getSuppressed(Throwable throwable)
Throwable.getSuppressed()
. Marked as deprecated because Java 6 is
deprecated.throwable
- a ThrowableThrowable.getSuppressed()
Throwable.getSuppressed()
public static boolean isGetSuppressedAvailable()
public static List<String> toStringList(Throwable throwable)
throwable
- the Throwablepublic static void rethrow(Throwable t)
Throwable
, wrapping checked exceptions into an UndeclaredThrowableException
.t
- the Throwable to throw.RuntimeException
- if t
is a RuntimeExceptionError
- if t
is an ErrorUndeclaredThrowableException
- if t
is a checked ExceptionCopyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.