@API(value=MAINTAINED) public class EvaluationContext extends Object
The primary state of an evaluation context is a set of parameter Bindings
.
QueryComponent.eval(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, com.apple.foundationdb.record.provider.foundationdb.FDBRecord<M>)
,
RecordQueryPlan.execute(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, byte[], com.apple.foundationdb.record.ExecuteProperties)
Modifier and Type | Field and Description |
---|---|
static EvaluationContext |
EMPTY |
Modifier and Type | Method and Description |
---|---|
EvaluationContextBuilder |
childBuilder()
Construct a builder from this context.
|
static EvaluationContext |
empty()
Get an empty evaluation context.
|
static EvaluationContext |
forBinding(String bindingName,
Object value)
Create a new
EvaluationContext with a single binding. |
static EvaluationContext |
forBindings(Bindings bindings)
Create a new
EvaluationContext around a given set of Bindings
from parameter names to values. |
Object |
getBinding(String name)
Get the value bound to a single parameter.
|
Bindings |
getBindings()
Retrieve the mapping from parameter names to values associated with
this context.
|
static EvaluationContextBuilder |
newBuilder()
Construct a new builder from this context.
|
EvaluationContext |
withBinding(String bindingName,
Object value)
Create a new
EvaluationContext with an additional binding. |
public static final EvaluationContext EMPTY
public static EvaluationContext empty()
@Nonnull public static EvaluationContext forBindings(@Nonnull Bindings bindings)
EvaluationContext
around a given set of Bindings
from parameter names to values.bindings
- a mapping from parameter name to values@Nonnull public static EvaluationContext forBinding(@Nonnull String bindingName, @Nullable Object value)
EvaluationContext
with a single binding.bindingName
- the binding name to addvalue
- the value to bind the name toEvaluationContext
with the new binding@Nonnull public Bindings getBindings()
@Nullable public Object getBinding(@Nonnull String name)
name
- the name of the parameter to retrieve the binding ofBindings.get(String)
@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.@Nonnull public static EvaluationContextBuilder newBuilder()
@Nonnull public EvaluationContext withBinding(@Nonnull String bindingName, @Nullable 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