@Deprecated
public abstract class Functions
extends java.lang.Object
Constructor and Description |
---|
Functions()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <T> Consumer<T> |
chain(Consumer<T>... consumers)
Deprecated.
|
static <T> Consumer<T> |
consumer(java.lang.Runnable r)
Deprecated.
Wrap the given
Runnable and compose a new Consumer . |
static <T,V> Function<T,V> |
function(java.util.concurrent.Callable<V> c)
Deprecated.
Wrap the given
Callable and compose a new Function . |
static <LEFT,RIGHT,V> |
functionFrom(BiFunction<LEFT,RIGHT,V> pairFunction)
Deprecated.
Wrap a given
BiFunction that applies transformation to a Tuple2 into a Function Tuple2. |
static <LEFT,RIGHT,V> |
pairFrom(Function<Tuple2<LEFT,RIGHT>,V> function)
Deprecated.
Wrap a given
Function that applies transformation to a Tuple2 into a PairFunction. |
static <T> Supplier<T> |
supplier(java.util.concurrent.Callable<T> callable)
Deprecated.
Creates a
Supplier that will call the callable
each time it's asked for a value. |
static <T> Supplier<T> |
supplier(java.lang.Class<T> type)
Deprecated.
Creates a
Supplier that will return a new instance of type each time
it's called. |
static <T> Supplier<T> |
supplier(java.util.concurrent.Future<T> future)
Deprecated.
Creates a
Supplier that will get its value from the
future each time it's asked for a value. |
static <T> Supplier<T> |
supplier(T value)
Deprecated.
Creates a
Supplier that will always return the given value . |
public static <T,V> Function<T,V> function(java.util.concurrent.Callable<V> c)
Callable
and compose a new Function
.c
- The Callable
.Consumer
that executes the Callable
.public static <LEFT,RIGHT,V> BiFunction<LEFT,RIGHT,V> pairFrom(Function<Tuple2<LEFT,RIGHT>,V> function)
Function
that applies transformation to a Tuple2 into a PairFunction.function
- tuple2 function to wrap into a PairFunctionBiFunction
that delegates to a new applied tuple if called with 2 arguments an to the applied tuple itself.public static <LEFT,RIGHT,V> Function<Tuple2<LEFT,RIGHT>,V> functionFrom(BiFunction<LEFT,RIGHT,V> pairFunction)
BiFunction
that applies transformation to a Tuple2 into a Function Tuple2.pairFunction
- PairFunction to wrap into a FunctionBiFunction
that delegates to a new applied tuple if called with 2 arguments an to the applied tuple itself.public static <T> Consumer<T> consumer(java.lang.Runnable r)
Runnable
and compose a new Consumer
.r
- The Runnable
.Consumer
that executes the Runnable
.public static <T> Supplier<T> supplier(T value)
Supplier
that will always return the given value
.value
- the value to be suppliedpublic static <T> Supplier<T> supplier(java.lang.Class<T> type)
Supplier
that will return a new instance of type
each time
it's called.type
- The type to createjava.lang.IllegalArgumentException
- if type
does not have a zero-args constructorpublic static <T> Supplier<T> supplier(java.util.concurrent.Callable<T> callable)
Supplier
that will call
the callable
each time it's asked for a value.callable
- The Callable
.Supplier
that executes the Callable
.