public static class FluentFunctions.FluentTriFunction<T1,T2,T3,R> extends java.lang.Object implements Fn3<T1,T2,T3,R>
Modifier and Type | Method and Description |
---|---|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
after(C4<T1,T2,T3,R> action)
Apply after advice to this TriFunction
|
<R2> FluentFunctions.FluentTriFunction<T1,T2,T3,R2> |
andThen(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)
Apply this function to the arguments.
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
around(java.util.function.Function<FluentFunctions.Advice3<T1,T2,T3,R>,R> around)
Apply around advic to 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 to 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 to 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 to 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>> |
liftF() |
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 to the provided Consumers
|
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
memoize() |
FluentFunctions.FluentTriFunction<T1,T2,T3,R> |
memoize(Cacheable<R> cache)
This methods creates a caching version of this BiFunction, caching is implemented via the Cacheable wrapper,
that can be used to 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 to this TriFunction to generate a Function (single input value)
|
FluentFunctions.FluentFunction<T3,R> |
partiallyApply(T1 param1,
T2 param2)
Partially apply the provided parameters to this BiFunction to generate a Function (single input)
|
FluentFunctions.FluentSupplier<R> |
partiallyApply(T1 param1,
T2 param2,
T3 param3)
Partially apply the provided parameters to this TriFunction to 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 to the eventConsumer, if there is an error it will be passed to the errorConsumer
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public R apply(T1 t1, T2 t2, T3 t3)
org.jooq.lambda.function.Function3
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> before(C3<T1,T2,T3> action)
action
- C3 to recieve the input parameters to TriFunctionpublic FluentFunctions.FluentTriFunction<T1,T2,T3,R> after(C4<T1,T2,T3,R> action)
action
- C4 to 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 to this Function via the Advice inout parameterpublic FluentFunctions.FluentBiFunction<T2,T3,R> partiallyApply(T1 param)
param
- Input parameter to 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> memoize()
public FluentFunctions.FluentTriFunction<T1,T2,T3,R> memoize(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")
.memoize((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 to recieve result on successful executionerrorConsumer
- Consumer to 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 to 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 to catch exceptions forpublic <W extends WitnessType<W>> FluentFunctions.FluentTriFunction<AnyM<W,T1>,AnyM<W,T2>,AnyM<W,T3>,AnyM<W,R>> liftF()
public FluentFunctions.FluentTriFunction<T1,T2,T3,java.util.concurrent.CompletableFuture<R>> liftAsync(java.util.concurrent.Executor ex)
ex
- Executor to execute this TriFunction onpublic java.util.concurrent.CompletableFuture<FluentFunctions.FluentTriFunction<T1,T2,T3,R>> async(java.util.concurrent.Executor ex)
ex
- Executor to manage operations on this function onpublic <R2> FluentFunctions.FluentTriFunction<T1,T2,T3,R2> andThen(java.util.function.Function<? super R,? extends R2> after)