@FunctionalInterface public interface Function3<S1,S2,S3,R> extends Function1<S1,Function1<S2,Function1<S3,R>>>
Function1.FunctionalOperations<T1,R>
Modifier and Type | Method and Description |
---|---|
default <V> Function3<S1,S2,S3,V> |
andThen3(java.util.function.Function<? super R,? extends V> after) |
default Function1<S2,Function1<S3,R>> |
apply(S1 s) |
default Function1<S3,R> |
apply(S1 s,
S2 s2) |
R |
apply(S1 a,
S2 b,
S3 c) |
default Function1<? super S1,Function1<? super S2,Function1<? super S3,? extends R>>> |
curry() |
default Function3<S1,S2,S3,Maybe<R>> |
lazyLift3() |
default Function3<S1,S2,S3,Option<R>> |
lift3() |
default Function3<S1,S2,S3,Future<R>> |
lift3(java.util.concurrent.Executor ex) |
default Function3<S1,S2,S3,Try<R,java.lang.Throwable>> |
liftTry3() |
default Function3<S1,S2,S3,R> |
memoize3() |
default Function3<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 to wrap any concrete cache implementation
E.g.
|
default Function3<S1,S2,S3,R> |
memoize3Async(java.util.concurrent.ScheduledExecutorService ex,
long timeToLiveMillis) |
default Function3<S1,S2,S3,R> |
memoize3Async(java.util.concurrent.ScheduledExecutorService ex,
java.lang.String cron) |
default <R2> R2 |
toType3(java.util.function.Function<? super Function3<? super S1,? super S2,? super S3,? extends R>,? extends R2> reduce) |
static <T1,T2,T3,R> |
λ(Function3<T1,T2,T3,R> triFunc) |
static <T1,T2,T3,R> |
λv(Function3<? super T1,? super T2,? super T3,? extends R> triFunc) |
after, always, andThen, andThen, apply, applyLazy, before, bind, coflatMapFn, compose, fanIn, firstFn, flatMapFn, functionOps, later, lazyLift, leftFn, lift, lift, liftTry, mapFn, memoize, memoize, memoizeAsync, memoizeAsync, merge, narrow, now, of, product, product, product, rightFn, secondFn, toType, λ, λv
static <T1,T2,T3,R> Function3<? super T1,? super T2,? super T3,? extends R> λv(Function3<? super T1,? super T2,? super T3,? extends R> triFunc)
default <R2> R2 toType3(java.util.function.Function<? super Function3<? super S1,? super S2,? super S3,? extends R>,? extends R2> reduce)
default Function3<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.getValue(key,()->f.applyHKT(key)));
fn.applyHKT(10,1,4);
fn.applyHKT(10,1,4);
fn.applyHKT(10,1,4);
assertThat(called,equalTo(1));
c
- Cache implementation wrapperdefault Function3<S1,S2,S3,R> memoize3Async(java.util.concurrent.ScheduledExecutorService ex, java.lang.String cron)
default Function3<S1,S2,S3,R> memoize3Async(java.util.concurrent.ScheduledExecutorService ex, long timeToLiveMillis)