public final class Functions
extends java.lang.Object
| Modifier and Type | Method | 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> ExceptionBiConsumer<java.util.function.Consumer<T>,T,java.lang.RuntimeException> |
consumerExceptionBiConsumer() |
Get the singleton consumer which accepts a consumer and an argument to hand to it.
|
static <T,U> java.util.function.BiConsumer<T,U> |
discardingBiConsumer() |
Get a consumer which discards the values it is given.
|
static <T> java.util.function.Consumer<T> |
discardingConsumer() |
Get a consumer which discards the values it is given.
|
static <T,U,E extends java.lang.Exception> |
discardingExceptionBiConsumer() |
Get a consumer which discards the values it is given.
|
static <T,E extends java.lang.Exception> |
discardingExceptionConsumer() |
Get a consumer which discards the values it is given.
|
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 <T,R> ExceptionBiFunction<java.util.function.Function<T,R>,T,R,java.lang.RuntimeException> |
functionExceptionBiFunction() |
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 ExceptionConsumer<java.lang.Runnable,java.lang.RuntimeException> |
runnableExceptionConsumer() |
Get the singleton exception consumer which accepts and runs runnable instances.
|
static <R> ExceptionFunction<java.util.function.Supplier<R>,R,java.lang.RuntimeException> |
supplierExceptionFunction() |
Get the singleton function which accepts a supplier and returns the result of the supplier.
|
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 ExceptionConsumer<java.lang.Runnable,java.lang.RuntimeException> runnableExceptionConsumer()
public 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 <T> ExceptionBiConsumer<java.util.function.Consumer<T>,T,java.lang.RuntimeException> consumerExceptionBiConsumer()
T - the argument 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> ExceptionFunction<java.util.function.Supplier<R>,R,java.lang.RuntimeException> supplierExceptionFunction()
R - the result 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,R> ExceptionBiFunction<java.util.function.Function<T,R>,T,R,java.lang.RuntimeException> functionExceptionBiFunction()
T - the argument typeR - the result 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 passpublic static <T> java.util.function.Consumer<T> discardingConsumer()
T - the parameter typepublic static <T,E extends java.lang.Exception> ExceptionConsumer<T,E> discardingExceptionConsumer()
T - the parameter typeE - the exception typepublic static <T,U> java.util.function.BiConsumer<T,U> discardingBiConsumer()
T - the first parameter typeU - the second parameter typepublic static <T,U,E extends java.lang.Exception> ExceptionBiConsumer<T,U,E> discardingExceptionBiConsumer()
T - the first parameter typeU - the second parameter typeE - the exception typeCopyright © 2018 JBoss, a division of Red Hat, Inc.