public class Exceptions extends Object
| Constructor and Description |
|---|
Exceptions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.function.Consumer<T> |
rethrow(ThrowingConsumer<T> consumer)
Transform a throwing consumer into a non throwing consumer by wrapping exceptions in RuntimeExceptions
|
static void |
rethrow(ThrowingRunnable runnable)
Try to run a runnable, rethrowing any exception wrapped in a RuntimeException
|
static <T,R> java.util.function.Function<T,R> |
rethrowR(ThrowingFunction<T,R> func)
Transform a throwing function into a non throwing function by wrapping exceptions in RuntimeExceptions
|
static <T> T |
rethrowR(ThrowingSupplier<T> supplier)
Try to get a value from the given supplier, rethrowing any exception wrapped in a RuntimeException
|
public static <T> T rethrowR(@NonNull
ThrowingSupplier<T> supplier)
T - the type of element to getsupplier - the supplier to get a value frompublic static void rethrow(@NonNull
ThrowingRunnable runnable)
runnable - the runnable to runpublic static <T,R> java.util.function.Function<T,R> rethrowR(@NonNull ThrowingFunction<T,R> func)
T - the functions input typeR - the functions return typefunc - the function to transformpublic static <T> java.util.function.Consumer<T> rethrow(@NonNull ThrowingConsumer<T> consumer)
T - the consumers input typeconsumer - the consumer to transformCopyright © 2017. All rights reserved.