public class Functionals
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Functionals.ConstantFunction<I,O>
like guava equivalent but parametrises the input generic type, and allows tostring to be customised
|
Constructor and Description |
---|
Functionals() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.concurrent.Callable<T> |
callable(<any> supplier) |
static <T,U> java.util.concurrent.Callable<U> |
callable(<any> f,
T x) |
static <A,B,C> <any> |
chain(<any> f1,
<any> f2)
applies f1 to the input, then the result of that is passed to f2 (note opposite semantics to
Functions#compose(Function, Function) |
static <A,B,C,D> <any> |
chain(<any> f1,
<any> f2,
<any> f3)
applies f1 to the input, then f2 to that result, then f3 to that result
|
static <A,B,C,D,E> |
chain(<any> f1,
<any> f2,
<any> f3,
<any> f4)
applies f1 to the input, then f2 to that result, then f3 to that result, then f4 to that result
|
static <I,O> <any> |
function(<any> supplier)
like guava
Functions#forSupplier(Supplier) but parametrises the input generic type |
static <I> <any> |
function(java.lang.Runnable runnable) |
static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> |
ifEquals(I test) |
static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> |
ifNotEquals(I test) |
static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> |
ifPredicate(<any> test) |
static <T> java.util.concurrent.Callable<java.lang.Boolean> |
isSatisfied(T subject,
<any> predicate)
Simple adapter from
Predicate to Callable by currying the passed subject parameter. |
static <T> <any> |
predicate(<any> f) |
static java.lang.Runnable |
runnable(<any> supplier) |
public static <A,B,C> <any> chain(<any> f1, <any> f2)
Functions#compose(Function, Function)
public static <A,B,C,D> <any> chain(<any> f1, <any> f2, <any> f3)
public static <A,B,C,D,E> <any> chain(<any> f1, <any> f2, <any> f3, <any> f4)
public static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> ifEquals(I test)
IfFunctions
public static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> ifNotEquals(I test)
IfFunctions
public static <I> IfFunctions.IfFunctionBuilderApplyingFirst<I> ifPredicate(<any> test)
IfFunctions
public static <I,O> <any> function(<any> supplier)
Functions#forSupplier(Supplier)
but parametrises the input generic typepublic static <I> <any> function(java.lang.Runnable runnable)
public static java.lang.Runnable runnable(<any> supplier)
public static <T> java.util.concurrent.Callable<T> callable(<any> supplier)
public static <T,U> java.util.concurrent.Callable<U> callable(<any> f, T x)
public static <T> <any> predicate(<any> f)
public static <T> java.util.concurrent.Callable<java.lang.Boolean> isSatisfied(T subject, <any> predicate)
Predicate
to Callable
by currying the passed subject parameter.