@FunctionalInterface public interface Fn3<S1,S2,S3,R> extends Fn1<S1,Fn1<S2,Fn1<S3,R>>>
Fn1.µ, Fn1.FunctionalOperations<T1,R>
Modifier and Type | Method and Description |
---|---|
default <V> Fn3<S1,S2,S3,V> |
andThen3(java.util.function.Function<? super R,? extends V> after) |
default Fn1<S2,Fn1<S3,R>> |
apply(S1 s)
Apply this function to the arguments.
|
default Fn1<S3,R> |
apply(S1 s,
S2 s2) |
R |
apply(S1 a,
S2 b,
S3 c) |
default Fn1<? super S1,Fn1<? super S2,Fn1<? super S3,? extends R>>> |
curry() |
default org.jooq.lambda.function.Function3<S1,S2,S3,R> |
function3() |
default Fn3<S1,S2,S3,Maybe<R>> |
lift3() |
default Fn3<S1,S2,S3,Future<R>> |
lift3(java.util.concurrent.Executor ex) |
default Fn3<S1,S2,S3,java.util.Optional<R>> |
liftOpt3() |
default Fn3<S1,S2,S3,Try<R,java.lang.Throwable>> |
liftTry3() |
default Fn3<S1,S2,S3,R> |
memoize3() |
default Fn3<S1,S2,S3,R> |
memoize3(Cacheable<R> c)
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.
|
default Fn3<S1,S2,S3,R> |
memoize3Async(java.util.concurrent.ScheduledExecutorService ex,
long timeToLiveMillis) |
default Fn3<S1,S2,S3,R> |
memoize3Async(java.util.concurrent.ScheduledExecutorService ex,
java.lang.String cron) |
static <T1,T2,T3,R> |
λ(Fn3<T1,T2,T3,R> triFunc) |
static <T1,T2,T3,R> |
λv(Fn3<? super T1,? super T2,? super T3,? extends R> triFunc) |
andThen, andThen, bind, compose, fanIn, firstFn, functionOps, leftFn, lift, lift, liftF, liftOpt, liftTry, memoize, memoize, memoizeAsync, memoizeAsync, merge, narrow, product, product, product, reader, rightFn, secondFn, λ, λv
static <T1,T2,T3,R> Fn3<? super T1,? super T2,? super T3,? extends R> λv(Fn3<? super T1,? super T2,? super T3,? extends R> triFunc)
default Fn3<S1,S2,S3,R> memoize3(Cacheable<R> c)
Cache<Object, Integer> cache = CacheBuilder.newBuilder()
.maximumSize(1000)
.expireAfterWrite(10, TimeUnit.MINUTES)
.build();
called=0;
Fn3<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));
cache
- Cache implementation wrapperdefault Fn3<S1,S2,S3,R> memoize3Async(java.util.concurrent.ScheduledExecutorService ex, java.lang.String cron)
default Fn3<S1,S2,S3,R> memoize3Async(java.util.concurrent.ScheduledExecutorService ex, long timeToLiveMillis)
default Fn1<S2,Fn1<S3,R>> apply(S1 s)
org.jooq.lambda.function.Function1