Interface Comparisons.Comparison
-
- All Superinterfaces:
PlanHashable
- All Known Implementing Classes:
Comparisons.ListComparison
,Comparisons.MultiColumnComparison
,Comparisons.NullComparison
,Comparisons.ParameterComparison
,Comparisons.SimpleComparison
,Comparisons.TextComparison
,Comparisons.TextContainsAllPrefixesComparison
,Comparisons.TextWithMaxDistanceComparison
- Enclosing class:
- Comparisons
public static interface Comparisons.Comparison extends PlanHashable
A comparison between a value associated with someplace in the record (such as a field) and a value associated with the plan (such as a constant or a bound parameter).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Boolean
eval(FDBRecordStoreBase<?> store, EvaluationContext context, Object value)
Evaluate this comparison for the value taken from the target record.default Object
getComparand()
Get the comparison value without any bindings.Object
getComparand(FDBRecordStoreBase<?> store, EvaluationContext context)
Get the comparison value from the evaluation context.Comparisons.Type
getType()
Get the comparison type.default boolean
hasMultiColumnComparand()
Get whether the comparison is with the result of a multi-column key.String
typelessString()
Get the printed representation of the comparison less the comparison operator itself.void
validate(Descriptors.FieldDescriptor descriptor, boolean fannedOut)
Validate that this comparison is compatible with a given record field.-
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash, planHash
-
-
-
-
Method Detail
-
eval
@Nullable Boolean eval(@Nonnull FDBRecordStoreBase<?> store, @Nonnull EvaluationContext context, @Nullable Object value)
Evaluate this comparison for the value taken from the target record.- Parameters:
store
- the record store for the querycontext
- the evaluation context for getting the other comparison valuevalue
- the value taken from the record- Returns:
- the tri-valued logic result of the comparison
-
validate
void validate(@Nonnull Descriptors.FieldDescriptor descriptor, boolean fannedOut)
Validate that this comparison is compatible with a given record field.- Parameters:
descriptor
- the Protobuf descriptor for the proposed comparison fieldfannedOut
- whether a repeated field fans out into multiple comparisons or is treated as a single list value
-
getType
@Nonnull Comparisons.Type getType()
Get the comparison type.- Returns:
- the comparison type
-
getComparand
@Nullable default Object getComparand()
Get the comparison value without any bindings.- Returns:
- the value to be compared
-
getComparand
@Nullable Object getComparand(@Nullable FDBRecordStoreBase<?> store, @Nullable EvaluationContext context)
Get the comparison value from the evaluation context.- Parameters:
store
- the record store for the querycontext
- the context for query evaluation- Returns:
- the value to be compared
-
hasMultiColumnComparand
default boolean hasMultiColumnComparand()
Get whether the comparison is with the result of a multi-column key. If so,getComparand()
will return aTuple
.- Returns:
true
if the comparand is for multiple key columns
-
-