public final class Uncheck
extends java.lang.Object
UncheckedIOException instead of IOException.| Modifier | Constructor and Description |
|---|---|
private |
Uncheck()
No instances needed.
|
| Modifier and Type | Method and Description |
|---|---|
static <T,U> void |
accept(IOBiConsumer<T,U> consumer,
T t,
U u)
Accepts an IO consumer with the given arguments.
|
static <T> void |
accept(IOConsumer<T> consumer,
T t)
Accepts an IO consumer with the given argument.
|
static <T,U,V> void |
accept(IOTriConsumer<T,U,V> consumer,
T t,
U u,
V v)
Accepts an IO consumer with the given arguments.
|
static <T,U,R> R |
apply(IOBiFunction<T,U,R> function,
T t,
U u)
Applies an IO function with the given arguments.
|
static <T,R> R |
apply(IOFunction<T,R> function,
T t)
Applies an IO function with the given arguments.
|
static <T,U,V,W,R> |
apply(IOQuadFunction<T,U,V,W,R> function,
T t,
U u,
V v,
W w)
Applies an IO quad-function with the given arguments.
|
static <T,U,V,R> R |
apply(IOTriFunction<T,U,V,R> function,
T t,
U u,
V v)
Applies an IO tri-function with the given arguments.
|
static <T> int |
compare(IOComparator<T> comparator,
T t,
T u)
Compares the arguments with the comparator.
|
static <T> T |
get(IOSupplier<T> supplier)
Gets the result from an IO supplier.
|
static <T> T |
get(IOSupplier<T> supplier,
java.util.function.Supplier<java.lang.String> message)
Gets the result from an IO supplier.
|
static int |
getAsInt(IOIntSupplier supplier)
Gets the result from an IO int supplier.
|
static int |
getAsInt(IOIntSupplier supplier,
java.util.function.Supplier<java.lang.String> message)
Gets the result from an IO int supplier.
|
static long |
getAsLong(IOLongSupplier supplier)
Gets the result from an IO long supplier.
|
static long |
getAsLong(IOLongSupplier supplier,
java.util.function.Supplier<java.lang.String> message)
Gets the result from an IO long supplier.
|
static void |
run(IORunnable runnable)
Runs an IO runnable.
|
static void |
run(IORunnable runnable,
java.util.function.Supplier<java.lang.String> message)
Runs an IO runnable.
|
static <T> boolean |
test(IOPredicate<T> predicate,
T t)
Tests an IO predicate.
|
private static java.io.UncheckedIOException |
wrap(java.io.IOException e)
Constructs a new UncheckedIOException for the given exception.
|
private static java.io.UncheckedIOException |
wrap(java.io.IOException e,
java.util.function.Supplier<java.lang.String> message)
Constructs a new UncheckedIOException for the given exception and detail message.
|
public static <T,U> void accept(IOBiConsumer<T,U> consumer, T t, U u)
T - the first input type.U - the second input type.t - the first input argument.u - the second input argument.consumer - Consumes the value.java.io.UncheckedIOException - if an I/O error occurs.public static <T> void accept(IOConsumer<T> consumer, T t)
T - the input type.t - the input argument.consumer - Consumes the value.java.io.UncheckedIOException - if an I/O error occurs.public static <T,U,V> void accept(IOTriConsumer<T,U,V> consumer, T t, U u, V v)
T - the first input type.U - the second input type.V - the third input type.t - the first input argument.u - the second input argument.v - the third input argument.consumer - Consumes the value.java.io.UncheckedIOException - if an I/O error occurs.public static <T,U,R> R apply(IOBiFunction<T,U,R> function, T t, U u)
T - the first function argument type.U - the second function argument type.R - the return type.function - the function.t - the first function argument.u - the second function argument.java.io.UncheckedIOException - if an I/O error occurs.public static <T,R> R apply(IOFunction<T,R> function, T t)
T - the first function argument type.R - the return type.function - the function.t - the first function argument.java.io.UncheckedIOException - if an I/O error occurs.public static <T,U,V,W,R> R apply(IOQuadFunction<T,U,V,W,R> function, T t, U u, V v, W w)
T - the first function argument type.U - the second function argument type.V - the third function argument type.W - the fourth function argument type.R - the return type.function - the function.t - the first function argument.u - the second function argument.v - the third function argument.w - the fourth function argument.java.io.UncheckedIOException - if an I/O error occurs.public static <T,U,V,R> R apply(IOTriFunction<T,U,V,R> function, T t, U u, V v)
T - the first function argument type.U - the second function argument type.V - the third function argument type.R - the return type.function - the function.t - the first function argument.u - the second function argument.v - the third function argument.java.io.UncheckedIOException - if an I/O error occurs.public static <T> int compare(IOComparator<T> comparator, T t, T u)
T - the first function argument type.comparator - the function.t - the first function argument.u - the second function argument.java.io.UncheckedIOException - if an I/O error occurs.public static <T> T get(IOSupplier<T> supplier)
T - the return type of the operations.supplier - Supplies the return value.java.io.UncheckedIOException - if an I/O error occurs.public static <T> T get(IOSupplier<T> supplier, java.util.function.Supplier<java.lang.String> message)
T - the return type of the operations.supplier - Supplies the return value.message - The UncheckedIOException message if an I/O error occurs.java.io.UncheckedIOException - if an I/O error occurs.public static int getAsInt(IOIntSupplier supplier)
supplier - Supplies the return value.java.io.UncheckedIOException - if an I/O error occurs.public static int getAsInt(IOIntSupplier supplier, java.util.function.Supplier<java.lang.String> message)
supplier - Supplies the return value.message - The UncheckedIOException message if an I/O error occurs.java.io.UncheckedIOException - if an I/O error occurs.public static long getAsLong(IOLongSupplier supplier)
supplier - Supplies the return value.java.io.UncheckedIOException - if an I/O error occurs.public static long getAsLong(IOLongSupplier supplier, java.util.function.Supplier<java.lang.String> message)
supplier - Supplies the return value.message - The UncheckedIOException message if an I/O error occurs.java.io.UncheckedIOException - if an I/O error occurs.public static void run(IORunnable runnable)
runnable - The runnable to run.java.io.UncheckedIOException - if an I/O error occurs.public static void run(IORunnable runnable, java.util.function.Supplier<java.lang.String> message)
runnable - The runnable to run.message - The UncheckedIOException message if an I/O error occurs.java.io.UncheckedIOException - if an I/O error occurs.public static <T> boolean test(IOPredicate<T> predicate, T t)
T - the type of the input to the predicate.predicate - the predicate.t - the input to the predicate.true if the input argument matches the predicate, otherwise false.private static java.io.UncheckedIOException wrap(java.io.IOException e)
e - The exception to wrap.UncheckedIOException.private static java.io.UncheckedIOException wrap(java.io.IOException e,
java.util.function.Supplier<java.lang.String> message)
e - The exception to wrap.message - The UncheckedIOException message if an I/O error occurs.UncheckedIOException.