T
- The enclosed typepublic static interface EvalContext.Value<T>
EvalContext.value(Fn)
, flatMap(Function)
and
consume(Consumer)
to get a working context with it's associated value type.Modifier and Type | Method and Description |
---|---|
void |
consume(Consumer<T> consumer)
Consume the enclosed value.
|
EvalContext |
context()
The
EvalContext that created this value. |
<U> EvalContext.Value<U> |
flatMap(Function<? super T,? extends EvalContext.Value<? extends U>> fn)
Map the enclosed value through a function that return another
EvalContext.Value . |
default T |
get() |
default <U> EvalContext.Value<U> |
map(Function<? super T,? extends U> fn)
Map the enclosed value through a function and return a
EvalContext.Value enclosing that result. |
void |
onFail(Consumer<Throwable> errorConsumer)
Consume any error the occurred while constructing the enclosed value.
|
default CompletableFuture<T> |
toFuture() |
EvalContext context()
EvalContext
that created this value.void consume(Consumer<T> consumer)
consumer
- The code that should consume the valuevoid onFail(Consumer<Throwable> errorConsumer)
errorConsumer
- The code that should consume the errordefault <U> EvalContext.Value<U> map(Function<? super T,? extends U> fn)
EvalContext.Value
enclosing that result.U
- The type of the new enclosed valuefn
- The function to map the enclosed value through<U> EvalContext.Value<U> flatMap(Function<? super T,? extends EvalContext.Value<? extends U>> fn)
EvalContext.Value
.
The returned other value could be from a different EvalContext
so the implementor
of this context should take care of how to bridge the value semantics to the returned value.
U
- The type of the new enclosed valuefn
- The function to map the enclosed value throughdefault CompletableFuture<T> toFuture()
default T get()
Copyright © 2020. All rights reserved.