public abstract class EvaluationContext
extends java.lang.Object
The primary state of an evaluation context is a set of parameter Bindings
.
QueryComponent.eval(com.apple.foundationdb.record.provider.foundationdb.FDBEvaluationContext<M>, com.apple.foundationdb.record.provider.foundationdb.FDBRecord<M>)
,
RecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBEvaluationContext<M>, byte[], com.apple.foundationdb.record.ExecuteProperties)
Modifier | Constructor and Description |
---|---|
protected |
EvaluationContext(Bindings bindings)
Construct a new
EvaluationContext around a given set of Bindings
from parameter names to values. |
Modifier and Type | Method and Description |
---|---|
EvaluationContextBuilder |
childBuilder()
Construct a builder from this context.
|
java.lang.Object |
getBinding(java.lang.String name)
Get the value bound to a single parameter.
|
Bindings |
getBindings()
Retrieve the mapping from parameter names to values associated with
this context.
|
java.util.concurrent.Executor |
getExecutor()
Get the
Executor to use when executing asynchronous calls. |
EvaluationContext |
withBinding(java.lang.String bindingName,
java.lang.Object value)
Create a new
EvaluationContext with an additional binding. |
protected abstract EvaluationContext |
withBindings(Bindings newBindings)
Create a new
EvaluationContext with a new set of parameter bindings. |
protected EvaluationContext(@Nonnull Bindings bindings)
EvaluationContext
around a given set of Bindings
from parameter names to values. This constructor exists for implementations
of this abstract class to pass state about their parameter bindings to the
super-class interface. Users of this class should use a builder of one of
this class's children.bindings
- a mapping from parameter name to values@Nonnull public Bindings getBindings()
@Nullable public java.lang.Object getBinding(@Nonnull java.lang.String name)
name
- the name of the parameter to retrieve the binding ofBindings.get(String)
@Nonnull public java.util.concurrent.Executor getExecutor()
Executor
to use when executing asynchronous calls.Executor
associated with this context@Nonnull protected abstract EvaluationContext withBindings(@Nonnull Bindings newBindings)
EvaluationContext
with a new set of parameter bindings.
Implementations should provide an implementation of this method
that ensures that all data contained within the context other than the
bindings is transferred over to the new context.newBindings
- the complete mapping of new Bindings
to associate with the new context@Nonnull public EvaluationContextBuilder childBuilder()
EvaluationContext
that has all of the same data
as the current context except for a few modifications expressed as
mutations made to the builder.public EvaluationContext withBinding(@Nonnull java.lang.String bindingName, @Nullable java.lang.Object value)
EvaluationContext
with an additional binding.
The returned context will have all of the same state as the current
context included all bindings except that it will bind an additional
parameter to an additional value.bindingName
- the binding name to addvalue
- the value to bind the name toEvaluationContext
with the new binding