public static class FluentFunctions.FluentTriFunction<T1,T2,T3,R> extends java.lang.Object implements Fn3<T1,T2,T3,R>
Fn1.µ, Fn1.FunctionalOperations<T1,R>
Modifier and Type | Method and Description |
---|---|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
after(C4<T1,T2,T3,R> action)
Apply after advice toNested this TriFunction
|
<R2> FluentFunctions.FluentTriFunction<T1,T2,T3,R2> |
andThen3(java.util.function.Function<? super R,? extends R2> after)
Compose this TriFunction with the provided function into a single TriFunction.
|
R |
apply(T1 t1,
T2 t2,
T3 t3) |
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
around(java.util.function.Function<FluentFunctions.Advice3<T1,T2,T3,R>,R> around)
Apply around advic toNested this TriFunction
|
java.util.concurrent.CompletableFuture<FluentFunctions.FluentTriFunction<T1,T2,T3,R>> |
async(java.util.concurrent.Executor ex)
Move this function into an asynchronous context
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
before(C3<T1,T2,T3> action)
Apply before advice toNested this TriFunction
|
FluentFunctions.FluentFunction<? super T1,Fn1<? super T2,Fn1<? super T3,? extends R>>> |
curry()
Curry this BiFunction, that is convert it from a TriFunction that accepts thre input parameters toNested a 'chain'
of three Functions that accept a single parameter
|
ReactiveSeq<R> |
generate(T1 input1,
T2 input2,
T3 input3)
Generate an infinite Stream by applying the input parameters toNested this function
repeatedly
|
ReactiveSeq<R> |
iterate(T1 seed1,
T2 seed2,
T3 seed3,
java.util.function.Function<R,org.jooq.lambda.tuple.Tuple3<T1,T2,T3>> mapToType)
Generate an infinite Stream from the provided seed values and mapping function.
|
FluentFunctions.FluentTriFunction<T1,T2,T3,java.util.concurrent.CompletableFuture<R>> |
liftAsync(java.util.concurrent.Executor ex)
Convert this TriFunction into one that executes asynchronously and returns a CompleteableFuture with the result
|
<W extends WitnessType<W>> |
liftF3() |
FluentFunctions.FluentTriFunction<java.util.Optional<T1>,java.util.Optional<T2>,java.util.Optional<T3>,java.util.Optional<R>> |
liftOptional() |
<X extends java.lang.Throwable> |
liftTry(java.lang.Class<X>... classes) |
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
log(java.util.function.Consumer<java.lang.String> logger,
java.util.function.Consumer<java.lang.Throwable> error)
A TriFunction that logs it's success or error states toNested the provided Consumers
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
memoize3() |
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
memoize3(Cacheable<R> cache)
This methods creates a caching version of this BiFunction, caching is implemented via the Cacheable wrapper,
that can be used toNested wrap any concrete cache implementation
E.g.
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
name(java.lang.String name) |
FluentFunctions.FluentBiFunction<T2,T3,R> |
partiallyApply(T1 param)
Partially apply the provided parameter as the first parameter toNested this TriFunction toNested generate a Function (single input value)
|
FluentFunctions.FluentFunction<T3,R> |
partiallyApply(T1 param1,
T2 param2)
Partially apply the provided parameters toNested this BiFunction toNested generate a Function (single input)
|
FluentFunctions.FluentSupplier<R> |
partiallyApply(T1 param1,
T2 param2,
T3 param3)
Partially apply the provided parameters toNested this TriFunction toNested generate a Supplier (that takes no inputs)
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
println() |
<X extends java.lang.Throwable> |
recover(java.lang.Class<X> type,
Fn3<T1,T2,T3,R> onError)
A TriFunction that can recover from the specified exception types, using the provided recovery Function
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
retry(int times,
int backoffStartTime)
A TriFunction capable of retrying on failure using an exponential backoff strategy
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
visitEvent(java.util.function.Consumer<R> eventConsumer,
java.util.function.Consumer<java.lang.Throwable> errorConsumer)
Visit the result of this TriFunction once it has been executed, if the Function executes successfully the
result will be passes toNested the eventConsumer, if there is an error it will be passed toNested the errorConsumer
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply, function3, lift3, lift3, liftOpt3, liftTry3, memoize3Async, memoize3Async, λ, λv
after, andThen, andThen, before, bind, compose, fanIn, firstFn, functionOps, leftFn, lift, lift, liftF, liftOpt, liftTry, memoize, memoize, memoizeAsync, memoizeAsync, merge, narrow, product, product, product, reader, rightFn, secondFn, λ, λv
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> before(C3<T1,T2,T3> action)
action
- C3 toNested recieve the input parameters toNested TriFunctionpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> after(C4<T1,T2,T3,R> action)
action
- C4 toNested recieve the input parameters and result from this TriFunctionpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> around(java.util.function.Function<FluentFunctions.Advice3<T1,T2,T3,R>,R> around)
FluentFunctions.of((a,b,c)->a+b+c)
.around(advice->advice.proceed1(advice.param1+1))
.println()
.apply(10,1,0)
//12
around
- Function that gives controlling access toNested this Function via the Advice inout parameterpublic FluentFunctions.FluentBiFunction<T2,T3,R> partiallyApply(T1 param)
param
- Input parameter toNested Partially Appliedpublic FluentFunctions.FluentFunction<T3,R> partiallyApply(T1 param1, T2 param2)
param1
- First Input parameterparam2
- Second Input parameterpublic FluentFunctions.FluentSupplier<R> partiallyApply(T1 param1, T2 param2, T3 param3)
param1
- First Input parameterparam2
- Second Input parameterparam3
- Third Input parameterpublic FluentFunctions.FluentFunction<? super T1,Fn1<? super T2,Fn1<? super T3,? extends R>>> curry()
public int add(Integer a,Integer b, Integer c ){
return a+b;
}
FluentFunctions.of(this::add)
.curry()
.apply(1)
.apply(2)
.apply(3);
//6
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> memoize3()
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> memoize3(Cacheable<R> cache)
Cache<Object, Integer> cache = CacheBuilder.newBuilder()
.maximumSize(1000)
.expireAfterWrite(10, TimeUnit.MINUTES)
.build();
called=0;
TriFunction<Integer,Integer,Integer> fn = FluentFunctions.of(this::add)
.name("myFunction")
.memoize3((key,f)->cache.get(key,()->f.apply(key)));
fn.apply(10,1,4);
fn.apply(10,1,4);
fn.apply(10,1,4);
assertThat(called,equalTo(1));
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> name(java.lang.String name)
name
- To give this TriFunctionpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> log(java.util.function.Consumer<java.lang.String> logger, java.util.function.Consumer<java.lang.Throwable> error)
logger
- Success loggererror
- Failure loggerpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> visitEvent(java.util.function.Consumer<R> eventConsumer, java.util.function.Consumer<java.lang.Throwable> errorConsumer)
eventConsumer
- Consumer toNested recieve result on successful executionerrorConsumer
- Consumer toNested recieve error on failurepublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> println()
public <X extends java.lang.Throwable> FluentFunctions.FluentTriFunction<T1,T2,T3,R> recover(java.lang.Class<X> type, Fn3<T1,T2,T3,R> onError)
type
- Recoverable exception typesonError
- Recovery BiFunctionpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> retry(int times, int backoffStartTime)
times
- Number of times toNested retrybackoffStartTime
- Wait time before first retrypublic ReactiveSeq<R> iterate(T1 seed1, T2 seed2, T3 seed3, java.util.function.Function<R,org.jooq.lambda.tuple.Tuple3<T1,T2,T3>> mapToType)
FluentFunctions.of(this::add)
.iterate(1,2,3,(i)->Tuple.tuple(i,i,i))
.limit(2)
.printOut();
//6
18
seed1
- Initial input parameter 1seed2
- Initial input parameter 2seed3
- Initial input parameter 3mapToType
- Reversed mapping functionpublic ReactiveSeq<R> generate(T1 input1, T2 input2, T3 input3)
input1
- First input parameterinput2
- Second input parameterinput3
- Third input parameterpublic FluentFunctions.FluentTriFunction<java.util.Optional<T1>,java.util.Optional<T2>,java.util.Optional<T3>,java.util.Optional<R>> liftOptional()
public <X extends java.lang.Throwable> FluentFunctions.FluentTriFunction<T1,T2,T3,Try<R,X>> liftTry(java.lang.Class<X>... classes)
classes
- Classes toNested catch exceptions forpublic <W extends WitnessType<W>> FluentFunctions.FluentTriFunction<AnyM<W,T1>,AnyM<W,T2>,AnyM<W,T3>,AnyM<W,R>> liftF3()
public FluentFunctions.FluentTriFunction<T1,T2,T3,java.util.concurrent.CompletableFuture<R>> liftAsync(java.util.concurrent.Executor ex)
ex
- Executor toNested execute this TriFunction onpublic java.util.concurrent.CompletableFuture<FluentFunctions.FluentTriFunction<T1,T2,T3,R>> async(java.util.concurrent.Executor ex)
ex
- Executor toNested manage operations on this function onpublic <R2> FluentFunctions.FluentTriFunction<T1,T2,T3,R2> andThen3(java.util.function.Function<? super R,? extends R2> after)