public final class Throwables extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Throwables.ThrowingCallable<R,T extends Throwable>
Lambda function checked exception
|
static interface |
Throwables.ThrowingComparator<E,T extends Throwable> |
static interface |
Throwables.ThrowingConsumer<E,T extends Throwable>
Lambda function checked exception
|
static interface |
Throwables.ThrowingFunction<E,R,T extends Throwable>
Lambda function checked exception
|
static interface |
Throwables.ThrowingRunnable<T extends Throwable> |
static interface |
Throwables.ThrowingSupplier<R,T extends Throwable>
Lambda function checked exception
|
| 构造器和说明 |
|---|
Throwables() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <R,T extends Throwable> |
callable(Throwables.ThrowingCallable<R,T> callable) |
static <E> void |
caught(Throwables.ThrowingConsumer<E,?> consumer,
E arg) |
static <E,R> R |
caught(Throwables.ThrowingFunction<E,R,?> function,
E arg) |
static <E,R> R |
caught(Throwables.ThrowingFunction<E,R,?> function,
E arg,
R defaultValue) |
static void |
caught(Throwables.ThrowingRunnable<?> runnable) |
static void |
caught(Throwables.ThrowingRunnable<?> runnable,
String message) |
static void |
caught(Throwables.ThrowingRunnable<?> runnable,
Supplier<String> message) |
static <R> R |
caught(Throwables.ThrowingSupplier<R,?> supplier) |
static <E> void |
checked(Throwables.ThrowingConsumer<E,?> consumer,
E arg) |
static <E,R> R |
checked(Throwables.ThrowingFunction<E,R,?> function,
E arg) |
static <E,R> R |
checked(Throwables.ThrowingFunction<E,R,?> function,
E arg,
R defaultValue) |
static void |
checked(Throwables.ThrowingRunnable<?> runnable) |
static <R> R |
checked(Throwables.ThrowingSupplier<R,?> supplier) |
static <E,T extends Throwable> |
comparator(Throwables.ThrowingComparator<E,T> comparator) |
static <E,T extends Throwable> |
consumer(Throwables.ThrowingConsumer<E,T> consumer) |
static <E,R,T extends Throwable> |
function(Throwables.ThrowingFunction<E,R,T> function) |
static String |
getRootCauseMessage(Throwable throwable) |
static String |
getRootCauseStackTrace(Throwable throwable)
Gets the root cause throwable stack trace
|
static void |
ignored(Throwables.ThrowingRunnable<?> runnable) |
static <R> R |
ignored(Throwables.ThrowingSupplier<R,?> supplier) |
static <T extends Throwable> |
runnable(Throwables.ThrowingRunnable<T> runnable)
eg: new Thread(Throwables.runnable(printer::print))
|
static <R,T extends Throwable> |
supplier(Throwables.ThrowingSupplier<R,T> supplier) |
public static String getRootCauseStackTrace(Throwable throwable)
throwable - the throwablepublic static <T extends Throwable> Runnable runnable(Throwables.ThrowingRunnable<T> runnable)
T - the type of Throwablerunnable - the ThrowingRunnablepublic static <R,T extends Throwable> Callable<R> callable(Throwables.ThrowingCallable<R,T> callable)
public static <E,T extends Throwable> Consumer<E> consumer(Throwables.ThrowingConsumer<E,T> consumer)
public static <E,R,T extends Throwable> Function<E,R> function(Throwables.ThrowingFunction<E,R,T> function)
public static <R,T extends Throwable> Supplier<R> supplier(Throwables.ThrowingSupplier<R,T> supplier)
public static <E,T extends Throwable> Comparator<? super E> comparator(Throwables.ThrowingComparator<E,T> comparator)
public static void caught(Throwables.ThrowingRunnable<?> runnable)
public static void caught(Throwables.ThrowingRunnable<?> runnable, String message)
public static void caught(Throwables.ThrowingRunnable<?> runnable, Supplier<String> message)
public static <R> R caught(Throwables.ThrowingSupplier<R,?> supplier)
public static <E> void caught(Throwables.ThrowingConsumer<E,?> consumer, E arg)
public static <E,R> R caught(Throwables.ThrowingFunction<E,R,?> function, E arg)
public static <E,R> R caught(Throwables.ThrowingFunction<E,R,?> function, E arg, R defaultValue)
public static void checked(Throwables.ThrowingRunnable<?> runnable)
public static <R> R checked(Throwables.ThrowingSupplier<R,?> supplier)
public static <E> void checked(Throwables.ThrowingConsumer<E,?> consumer, E arg)
public static <E,R> R checked(Throwables.ThrowingFunction<E,R,?> function, E arg)
public static <E,R> R checked(Throwables.ThrowingFunction<E,R,?> function, E arg, R defaultValue)
public static void ignored(Throwables.ThrowingRunnable<?> runnable)
public static <R> R ignored(Throwables.ThrowingSupplier<R,?> supplier)
Copyright © 2023. All rights reserved.