public class Unchecker extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Unchecker.ThrowingBiConsumer<T,U>
Operation that accepts two arguments and returns no result, but could throw a checked exception
|
static interface |
Unchecker.ThrowingBiFunction<In1,In2,Out>
Function that accepts two arguments and produces a result, but could throw a checked exception
|
static interface |
Unchecker.ThrowingConsumer<T>
Operation that accepts a single input argument and returns no result, but could throw a checked exception
|
static interface |
Unchecker.ThrowingFunction<In,Out>
Function that accepts a single argument and produces a result, but could throw a checked exception
|
static interface |
Unchecker.ThrowingRunnable
Operation that returns no result, but could throw a checked exception
|
static interface |
Unchecker.ThrowingSupplier<T>
Represents a supplier of results, that could throw a checked exception
|
| Constructor and Description |
|---|
Unchecker() |
| Modifier and Type | Method and Description |
|---|---|
static <T,U> BiConsumer<T,U> |
uncheck(Unchecker.ThrowingBiConsumer<T,U> consumer)
As
uncheck(alexh.Unchecker.ThrowingBiConsumer, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <T,U> BiConsumer<T,U> |
uncheck(Unchecker.ThrowingBiConsumer<T,U> consumer,
Function<Throwable,? extends RuntimeException> exTransformer)
As
uncheck(alexh.Unchecker.ThrowingConsumer, java.util.function.Function) for BiConsumers |
static <In1,In2,Out> |
uncheck(Unchecker.ThrowingBiFunction<In1,In2,Out> function)
As
uncheck(alexh.Unchecker.ThrowingBiFunction, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <In1,In2,Out> |
uncheck(Unchecker.ThrowingBiFunction<In1,In2,Out> function,
Function<Throwable,? extends RuntimeException> exTransformer)
As
uncheck(alexh.Unchecker.ThrowingFunction, java.util.function.Function) for BiFunctions |
static <T> Consumer<T> |
uncheck(Unchecker.ThrowingConsumer<T> consumer)
As
uncheck(alexh.Unchecker.ThrowingConsumer, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <T> Consumer<T> |
uncheck(Unchecker.ThrowingConsumer<T> consumer,
Function<Throwable,? extends RuntimeException> exTransformer)
Converts Checked throwing consumer -> standard consumer, any checked exceptions are wrapped using the input
exception transformer
|
static <In,Out> Function<In,Out> |
uncheck(Unchecker.ThrowingFunction<In,Out> function)
As
uncheck(alexh.Unchecker.ThrowingFunction, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <In,Out> Function<In,Out> |
uncheck(Unchecker.ThrowingFunction<In,Out> function,
Function<Throwable,? extends RuntimeException> exTransformer)
Converts Checked throwing function -> standard function, any checked exceptions are wrapped using the input
exception transformer
|
static Runnable |
uncheck(Unchecker.ThrowingRunnable runnable)
As
uncheck(alexh.Unchecker.ThrowingRunnable, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static Runnable |
uncheck(Unchecker.ThrowingRunnable runnable,
Function<Throwable,? extends RuntimeException> exTransformer)
Converts Checked throwing runnable -> standard runnable, any checked exceptions are wrapped using the input
exception transformer
|
static <T> Supplier<T> |
uncheck(Unchecker.ThrowingSupplier<T> supplier)
As
uncheck(alexh.Unchecker.ThrowingSupplier, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <T> Supplier<T> |
uncheck(Unchecker.ThrowingSupplier<T> supplier,
Function<Throwable,? extends RuntimeException> exTransformer)
Converts Checked throwing supplier -> standard supplier, any checked exceptions are wrapped using the input
exception transformer
|
static void |
unchecked(Unchecker.ThrowingRunnable runnable)
As
unchecked(alexh.Unchecker.ThrowingRunnable, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static void |
unchecked(Unchecker.ThrowingRunnable runnable,
Function<Throwable,? extends RuntimeException> exTransformer)
Runs wrapping any checked exceptions using the input exception transformer
|
static <T> T |
uncheckedGet(Unchecker.ThrowingSupplier<T> supplier)
As
uncheckedGet(alexh.Unchecker.ThrowingSupplier, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptions |
static <T> T |
uncheckedGet(Unchecker.ThrowingSupplier<T> supplier,
Function<Throwable,? extends RuntimeException> exTransformer)
Gets the supplier result wrapping any checked exceptions using the input exception transformer
|
public static <T> Supplier<T> uncheck(Unchecker.ThrowingSupplier<T> supplier, Function<Throwable,? extends RuntimeException> exTransformer)
supplier - supplier that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static <T> T uncheckedGet(Unchecker.ThrowingSupplier<T> supplier, Function<Throwable,? extends RuntimeException> exTransformer)
T - Supplier / return typesupplier - supplier that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static void unchecked(Unchecker.ThrowingRunnable runnable, Function<Throwable,? extends RuntimeException> exTransformer)
runnable - supplier that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static <In,Out> Function<In,Out> uncheck(Unchecker.ThrowingFunction<In,Out> function, Function<Throwable,? extends RuntimeException> exTransformer)
function - function that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static <In1,In2,Out> BiFunction<In1,In2,Out> uncheck(Unchecker.ThrowingBiFunction<In1,In2,Out> function, Function<Throwable,? extends RuntimeException> exTransformer)
uncheck(alexh.Unchecker.ThrowingFunction, java.util.function.Function) for BiFunctionspublic static Runnable uncheck(Unchecker.ThrowingRunnable runnable, Function<Throwable,? extends RuntimeException> exTransformer)
runnable - function that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static <T> Consumer<T> uncheck(Unchecker.ThrowingConsumer<T> consumer, Function<Throwable,? extends RuntimeException> exTransformer)
consumer - function that can throw a checked exceptionexTransformer - checked -> unchecked exception transformerpublic static <T,U> BiConsumer<T,U> uncheck(Unchecker.ThrowingBiConsumer<T,U> consumer, Function<Throwable,? extends RuntimeException> exTransformer)
uncheck(alexh.Unchecker.ThrowingConsumer, java.util.function.Function) for BiConsumerspublic static <T> Supplier<T> uncheck(Unchecker.ThrowingSupplier<T> supplier)
uncheck(alexh.Unchecker.ThrowingSupplier, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static <T> T uncheckedGet(Unchecker.ThrowingSupplier<T> supplier)
uncheckedGet(alexh.Unchecker.ThrowingSupplier, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static void unchecked(Unchecker.ThrowingRunnable runnable)
unchecked(alexh.Unchecker.ThrowingRunnable, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static <In,Out> Function<In,Out> uncheck(Unchecker.ThrowingFunction<In,Out> function)
uncheck(alexh.Unchecker.ThrowingFunction, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static <In1,In2,Out> BiFunction<In1,In2,Out> uncheck(Unchecker.ThrowingBiFunction<In1,In2,Out> function)
uncheck(alexh.Unchecker.ThrowingBiFunction, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static Runnable uncheck(Unchecker.ThrowingRunnable runnable)
uncheck(alexh.Unchecker.ThrowingRunnable, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static <T> Consumer<T> uncheck(Unchecker.ThrowingConsumer<T> consumer)
uncheck(alexh.Unchecker.ThrowingConsumer, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionspublic static <T,U> BiConsumer<T,U> uncheck(Unchecker.ThrowingBiConsumer<T,U> consumer)
uncheck(alexh.Unchecker.ThrowingBiConsumer, java.util.function.Function)
wrapping checked exceptions in RuntimeExceptionsCopyright © 2016. All rights reserved.