public final class Functions
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T,U> java.lang.Runnable |
capturingRunnable(java.util.function.BiConsumer<T,U> consumer,
T param1,
U param2)
Get a runnable which executes the given consumer with captured values.
|
static <T> java.lang.Runnable |
capturingRunnable(java.util.function.Consumer<T> consumer,
T param)
Get a runnable which executes the given consumer with captured values.
|
static <T,E extends java.lang.Exception> |
constantExceptionSupplier(T value)
Get a supplier which always returns the same value.
|
static <T> java.util.function.Supplier<T> |
constantSupplier(T value)
Get a supplier which always returns the same value.
|
static <T> java.util.function.BiConsumer<java.util.function.Consumer<T>,T> |
consumerBiConsumer()
Get the singleton consumer which accepts a consumer and an argument to hand to it.
|
static <T,U,E extends java.lang.Exception> |
exceptionCapturingRunnable(ExceptionBiConsumer<T,U,E> consumer,
T param1,
U param2)
Get a runnable which executes the given consumer with captured values.
|
static <T,E extends java.lang.Exception> |
exceptionCapturingRunnable(ExceptionConsumer<T,E> consumer,
T param)
Get a runnable which executes the given consumer with captured values.
|
static <T,E extends java.lang.Exception> |
exceptionConsumerBiConsumer()
Get the singleton consumer which accepts a consumer and an argument to hand to it.
|
static <T,R,E extends java.lang.Exception> |
exceptionFunctionBiFunction()
Get the singleton function which accepts a function and a parameter to pass to the function, and returns the
result of the function.
|
static <E extends java.lang.Exception> |
exceptionRunnableConsumer()
Get the singleton exception consumer which accepts and runs exception runnable instances.
|
static <R,E extends java.lang.Exception> |
exceptionSupplierFunction()
Get the singleton function which accepts a supplier and returns the result of the supplier.
|
static <R,E extends java.lang.Exception> |
exceptionSupplierFunctionBiFunction()
Get the singleton function which accepts a function which accepts a supplier, all of which return the result
of the supplier.
|
static <T,R> java.util.function.BiFunction<java.util.function.Function<T,R>,T,R> |
functionBiFunction()
Get the singleton function which accepts a function and a parameter to pass to the function, and returns the
result of the function.
|
static java.util.function.Consumer<java.lang.Runnable> |
runnableConsumer()
Get the singleton consumer which accepts and runs runnable instances.
|
static <R> java.util.function.Function<java.util.function.Supplier<R>,R> |
supplierFunction()
Get the singleton function which accepts a supplier and returns the result of the supplier.
|
static <R> java.util.function.BiFunction<java.util.function.Function<java.util.function.Supplier<R>,R>,java.util.function.Supplier<R>,R> |
supplierFunctionBiFunction()
Get the singleton function which accepts a function which accepts a supplier, all of which return the result
of the supplier.
|
public static java.util.function.Consumer<java.lang.Runnable> runnableConsumer()
public static <E extends java.lang.Exception> ExceptionConsumer<ExceptionRunnable<E>,E> exceptionRunnableConsumer()
E - the exception typepublic static <T> java.util.function.BiConsumer<java.util.function.Consumer<T>,T> consumerBiConsumer()
T - the argument typepublic static <T,E extends java.lang.Exception> ExceptionBiConsumer<ExceptionConsumer<T,E>,T,E> exceptionConsumerBiConsumer()
T - the argument typeE - the exception typepublic static <R> java.util.function.Function<java.util.function.Supplier<R>,R> supplierFunction()
R - the result typepublic static <R,E extends java.lang.Exception> ExceptionFunction<ExceptionSupplier<R,E>,R,E> exceptionSupplierFunction()
R - the result typeE - the exception typepublic static <R> java.util.function.BiFunction<java.util.function.Function<java.util.function.Supplier<R>,R>,java.util.function.Supplier<R>,R> supplierFunctionBiFunction()
R - the result typepublic static <R,E extends java.lang.Exception> ExceptionBiFunction<ExceptionFunction<ExceptionSupplier<R,E>,R,E>,ExceptionSupplier<R,E>,R,E> exceptionSupplierFunctionBiFunction()
R - the result typeE - the exception typepublic static <T,R> java.util.function.BiFunction<java.util.function.Function<T,R>,T,R> functionBiFunction()
T - the argument typeR - the result typepublic static <T,R,E extends java.lang.Exception> ExceptionBiFunction<ExceptionFunction<T,R,E>,T,R,E> exceptionFunctionBiFunction()
T - the argument typeR - the result typeE - the exception typepublic static <T> java.util.function.Supplier<T> constantSupplier(T value)
T - the value typevalue - the value to returnpublic static <T,E extends java.lang.Exception> ExceptionSupplier<T,E> constantExceptionSupplier(T value)
T - the value typeE - the exception typevalue - the value to returnpublic static <T,U> java.lang.Runnable capturingRunnable(java.util.function.BiConsumer<T,U> consumer,
T param1,
U param2)
T - the first parameter typeU - the second parameter typeconsumer - the consumer to run (must not be null)param1 - the first parameter to passparam2 - the second parameter to passpublic static <T> java.lang.Runnable capturingRunnable(java.util.function.Consumer<T> consumer,
T param)
T - the parameter typeconsumer - the consumer to run (must not be null)param - the parameter to passpublic static <T,U,E extends java.lang.Exception> ExceptionRunnable<E> exceptionCapturingRunnable(ExceptionBiConsumer<T,U,E> consumer, T param1, U param2)
T - the first parameter typeU - the second parameter typeE - the exception typeconsumer - the consumer to run (must not be null)param1 - the first parameter to passparam2 - the second parameter to passpublic static <T,E extends java.lang.Exception> ExceptionRunnable<E> exceptionCapturingRunnable(ExceptionConsumer<T,E> consumer, T param)
T - the parameter typeE - the exception typeconsumer - the consumer to run (must not be null)param - the parameter to passCopyright © 2017 JBoss, a division of Red Hat, Inc.