Package com.apple.foundationdb.record
Class EvaluationContext
java.lang.Object
com.apple.foundationdb.record.EvaluationContext
A context for query evaluation.
 
 The primary state of an evaluation context is a set of parameter Bindings.
 
- See Also:
- 
- 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)
 
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionConstruct a builder from this context.booleancontainsBinding(Bindings.Internal type, CorrelationIdentifier alias) Whether the bindings contain a given special internal correlation.booleancontainsBinding(String name) Whether a value is bound to the provided parameter.booleancontainsConstantBinding(CorrelationIdentifier alias, String constantId) Whether a value is bound to the given constant.dereferenceConstant(CorrelationIdentifier alias, String constantId) Dereferences the constant.static EvaluationContextempty()Get an empty evaluation context.static EvaluationContextforBinding(String bindingName, Object value) Create a newEvaluationContextwith a single binding.static EvaluationContextforBindings(Bindings bindings) Create a newEvaluationContextaround a given set ofBindingsfrom parameter names to values.static EvaluationContextforBindingsAndTypeRepository(Bindings bindings, TypeRepository typeRepository) static EvaluationContextforTypeRepository(TypeRepository typeRepository) getBinding(Bindings.Internal type, CorrelationIdentifier alias) Get the value bound to a single parameter.getBinding(String name) Get the value bound to a single parameter.Retrieve the mapping from parameter names to values associated with this context.static EvaluationContextBuilderConstruct a new builder from this context.withBinding(Bindings.Internal type, CorrelationIdentifier alias, Object value) Create a newEvaluationContextwith an additional binding.withBinding(String bindingName, Object value) Create a newEvaluationContextwith an additional binding.
- 
Field Details- 
EMPTY
 
- 
- 
Method Details- 
emptyGet an empty evaluation context.- Returns:
- an evaluation context with no bindings
 
- 
forBindingsCreate a newEvaluationContextaround a given set ofBindingsfrom parameter names to values.- Parameters:
- bindings- a mapping from parameter name to values
- Returns:
- a new evaluation context with the bindings
 
- 
forBindingsAndTypeRepository@Nonnull public static EvaluationContext forBindingsAndTypeRepository(@Nonnull Bindings bindings, @Nonnull TypeRepository typeRepository) Create a newEvaluationContextaround a given set ofBindingsand aTypeRepository. from parameter names to values.- Parameters:
- bindings- a mapping from parameter name to values
- typeRepository- a type repository
- Returns:
- a new evaluation context with the bindings and the schema.
 
- 
forTypeRepository
- 
forBinding@Nonnull public static EvaluationContext forBinding(@Nonnull String bindingName, @Nullable Object value) Create a newEvaluationContextwith a single binding.- Parameters:
- bindingName- the binding name to add
- value- the value to bind the name to
- Returns:
- a new EvaluationContextwith the new binding
 
- 
getBindingsRetrieve the mapping from parameter names to values associated with this context.- Returns:
- a mapping from parameter names to to values
 
- 
getBindingGet the value bound to a single parameter.- Parameters:
- name- the name of the parameter to retrieve the binding of
- Returns:
- the value bound to the given parameter
- See Also:
 
- 
getBindingGet the value bound to a single parameter.- Parameters:
- type- the type of the parameter
- alias- the correlation identifier
- Returns:
- the value bound to the given parameter
 
- 
containsBindingWhether a value is bound to the provided parameter.- Parameters:
- name- the name of the parameter to check
- Returns:
- whether a value is bound to the given parameter
- See Also:
 
- 
containsBindingpublic boolean containsBinding(@Nonnull Bindings.Internal type, @Nonnull CorrelationIdentifier alias) Whether the bindings contain a given special internal correlation.- Parameters:
- type- the type of the parameter
- alias- the parameter's alias
- Returns:
- whether the bindings contain that special correlation value
 
- 
containsConstantBindingpublic boolean containsConstantBinding(@Nonnull CorrelationIdentifier alias, @Nonnull String constantId) Whether a value is bound to the given constant.- Parameters:
- alias- the alias of the constant map
- constantId- the identity of the constant within the map
- Returns:
- whether a value is bound to the given constant
 
- 
dereferenceConstant@Nullable public Object dereferenceConstant(@Nonnull CorrelationIdentifier alias, @Nonnull String constantId) Dereferences the constant.- Parameters:
- alias- the correlation identifier
- constantId- the constant id
- Returns:
- de-referenced constant
 
- 
getTypeRepository
- 
childBuilderConstruct a builder from this context. This allows the user to create a newEvaluationContextthat has all of the same data as the current context except for a few modifications expressed as mutations made to the builder.- Returns:
- a builder for this class based on this instance
 
- 
newBuilderConstruct a new builder from this context.- Returns:
- a builder for this class based on this instance
 
- 
withBindingCreate a newEvaluationContextwith 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.- Parameters:
- bindingName- the binding name to add
- value- the value to bind the name to
- Returns:
- a new EvaluationContextwith the new binding
 
- 
withBindingpublic EvaluationContext withBinding(Bindings.Internal type, @Nonnull CorrelationIdentifier alias, @Nullable Object value) Create a newEvaluationContextwith 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.- Parameters:
- type- the type of the binding.
- alias- the alias determining the binding name to add
- value- the value to bind the name to
- Returns:
- a new EvaluationContextwith the new binding
 
 
-