public final class Values extends Object
EvalContext.Value
.Modifier and Type | Method and Description |
---|---|
static <T,U,V> EvalContext.Value<V> |
mapBoth(EvalContext context,
EvalContext.Value<T> first,
EvalContext.Value<U> second,
BiFunction<? super T,? super U,? extends V> fn)
Maps a function over two
EvalContext.Value s returning a new EvalContext.Value of the result which
only becomes available when both inputs have completed. |
static <T> Collector<EvalContext.Value<T>,?,EvalContext.Value<List<T>>> |
toValueList(EvalContext context)
|
public static <T,U,V> EvalContext.Value<V> mapBoth(EvalContext context, EvalContext.Value<T> first, EvalContext.Value<U> second, BiFunction<? super T,? super U,? extends V> fn)
EvalContext.Value
s returning a new EvalContext.Value
of the result which
only becomes available when both inputs have completed.
The returned EvalContext.Value
will not complete until both input values have completed either
successfully or with an exception. If both inputs fail with an exception, the exception from
first
will be propagated into the returned value, having the exception from
second
added as a suppressed exception to it.
T
- The type of the first input valueU
- The type of the second input valueV
- The type of the return valuecontext
- The context which values are processed infirst
- The first input valuesecond
- The second input valuefn
- The map functionpublic static <T> Collector<EvalContext.Value<T>,?,EvalContext.Value<List<T>>> toValueList(EvalContext context)
Collector
that collects a Stream
of EvalContext.Value
s into a EvalContext.Value
of a List
.
The semantics of joining EvalContext.Value
s is decided by this EvalContext
.
T
- The inner type of the valuescontext
- The context which values are processed inCopyright © 2020. All rights reserved.