public final class Conversion extends Object
XFunction)
to more common ones (e.g. Function) that, when executed, will wrap any occurring checked exception in a
WrappedException. Any unchecked exception that may occur will remain unaffected.Converter| Modifier and Type | Method and Description |
|---|---|
static <T,U> BiConsumer<T,U> |
biConsumer(XBiConsumer<T,U,?> xBiConsumer)
Converts an
XBiConsumer that may throw a checked exception to a BiConsumer that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <T,U,R> BiFunction<T,U,R> |
biFunction(XBiFunction<T,U,R,?> xBiFunction)
Converts an
XBiFunction that may throw a checked exception to a BiFunction that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <T,U> BiPredicate<T,U> |
biPredicate(XBiPredicate<T,U,?> xBiPredicate)
Converts an
XBiPredicate that may throw a checked exception to a BiPredicate that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <T> Consumer<T> |
consumer(XConsumer<T,?> xConsumer)
Converts an
XConsumer that may throw a checked exception to a Consumer that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <T,R> Function<T,R> |
function(XFunction<T,R,?> xFunction)
Converts an
XFunction that may throw a checked exception to a Function that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <R> R |
get(XSupplier<R,?> xSupplier)
Returns the result of a given
XSupplier and wraps any checked exception that may occur as a
WrappedException. |
static <T> Predicate<T> |
predicate(XPredicate<T,?> xPredicate)
Converts an
XPredicate that may throw a checked exception to a Predicate that,
when executed, wraps any occurring checked exception as a WrappedException. |
static void |
run(XRunnable<?> xRunnable)
Runs a given
XRunnable that wraps a checked exception that may occur as a WrappedException. |
static Runnable |
runnable(XRunnable<?> xRunnable)
Converts an
XRunnable that may throw a checked exception to a Runnable that,
when executed, wraps any occurring checked exception as a WrappedException. |
static <R> Supplier<R> |
supplier(XSupplier<R,?> xSupplier)
Converts an
XSupplier that may throw a checked exception to a Supplier that,
when executed, wraps any occurring checked exception as a WrappedException. |
public static Runnable runnable(XRunnable<?> xRunnable)
XRunnable that may throw a checked exception to a Runnable that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T> Consumer<T> consumer(XConsumer<T,?> xConsumer)
XConsumer that may throw a checked exception to a Consumer that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T,U> BiConsumer<T,U> biConsumer(XBiConsumer<T,U,?> xBiConsumer)
XBiConsumer that may throw a checked exception to a BiConsumer that,
when executed, wraps any occurring checked exception as a WrappedException.public static <R> Supplier<R> supplier(XSupplier<R,?> xSupplier)
XSupplier that may throw a checked exception to a Supplier that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T> Predicate<T> predicate(XPredicate<T,?> xPredicate)
XPredicate that may throw a checked exception to a Predicate that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T,U> BiPredicate<T,U> biPredicate(XBiPredicate<T,U,?> xBiPredicate)
XBiPredicate that may throw a checked exception to a BiPredicate that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T,R> Function<T,R> function(XFunction<T,R,?> xFunction)
XFunction that may throw a checked exception to a Function that,
when executed, wraps any occurring checked exception as a WrappedException.public static <T,U,R> BiFunction<T,U,R> biFunction(XBiFunction<T,U,R,?> xBiFunction)
XBiFunction that may throw a checked exception to a BiFunction that,
when executed, wraps any occurring checked exception as a WrappedException.public static void run(XRunnable<?> xRunnable)
XRunnable that wraps a checked exception that may occur as a WrappedException.public static <R> R get(XSupplier<R,?> xSupplier)
XSupplier and wraps any checked exception that may occur as a
WrappedException.R - The result type.Copyright © 2023 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.