public final class Throwables extends Object
| 构造器和说明 |
|---|
Throwables() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> void |
caught(Consumer<E> consumer,
E arg) |
static <E,R> R |
caught(Function<E,R> function,
E arg) |
static <E,R> R |
caught(Function<E,R> function,
E arg,
R defaultValue) |
static void |
caught(Runnable runnable) |
static <R> R |
caught(Supplier<R> supplier) |
static void |
checked(Throwable throwable) |
static void |
checked(Throwable throwable,
String msg)
Checked the throwable
|
static void |
console(Throwable throwable)
Prints the throwable stack trace to console
|
static String |
getRootCauseMessage(Throwable throwable) |
static String |
getRootCauseStackTrace(Throwable throwable)
Gets the root cause throwable stack trace
|
static void |
ignore(Throwable ignored)
Ignore the throwable
|
static void |
ignore(Throwable ignored,
boolean console)
Ignore the throwable, if
console is true then will be
print the throwable stack trace to console |
public static String getRootCauseStackTrace(Throwable throwable)
throwable - the throwablepublic static void ignore(Throwable ignored)
ignored - the Throwablepublic static void ignore(Throwable ignored, boolean console)
console is true then will be
print the throwable stack trace to consoleignored - the Throwableconsole - whether print console, true is printpublic static void console(Throwable throwable)
throwable - the Throwablepublic static void checked(Throwable throwable)
public static void checked(Throwable throwable, String msg)
throwable - the throwablemsg - the msgpublic static void caught(Runnable runnable)
public static <R> R caught(Supplier<R> supplier)
public static <E> void caught(Consumer<E> consumer, E arg)
public static <E,R> R caught(Function<E,R> function, E arg)
public static <E,R> R caught(Function<E,R> function, E arg, R defaultValue)
Copyright © 2023. All rights reserved.