@API(value=MAINTAINED) public class OneOfThemWithComparison extends Object implements ComponentWithComparison
QueryComponent
that evaluates a Comparisons.Comparison
against each of the values of a repeated field and is satisfied if any of those are.Constructor and Description |
---|
OneOfThemWithComparison(String fieldName,
Comparisons.Comparison comparison) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
eval, evalAsync, evalMessageAsync, isAsync
iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash
acceptPropertyVisitor, bindTo
public OneOfThemWithComparison(@Nonnull String fieldName, @Nonnull Comparisons.Comparison comparison)
@Nullable public <M extends Message> Boolean evalMessage(@Nonnull FDBRecordStoreBase<M> store, @Nonnull EvaluationContext context, @Nullable FDBRecord<M> record, @Nullable Message message)
QueryComponent
evalMessage
.
Under ordinary circumstances, if record
is null
, then message
will be null
.
Otherwise, message
will be record.getRecord()
or some submessage of that, possibly null
if
the corresponding field is missing.evalMessage
in interface QueryComponent
M
- the type of recordstore
- the record store from which the record camecontext
- context for bound expressionsrecord
- the recordmessage
- the Protobuf message to evaluate againstQueryComponent.eval(com.apple.foundationdb.record.provider.foundationdb.FDBRecordStoreBase<M>, com.apple.foundationdb.record.EvaluationContext, com.apple.foundationdb.record.provider.foundationdb.FDBRecord<M>)
public void validate(@Nonnull Descriptors.Descriptor descriptor)
QueryComponent
validate
in interface QueryComponent
descriptor
- a record type descriptor, or a submessage descriptor@Nonnull public Comparisons.Comparison getComparison()
getComparison
in interface ComponentWithComparison
public QueryComponent withOtherComparison(Comparisons.Comparison comparison)
withOtherComparison
in interface ComponentWithComparison
@Nonnull @API(value=EXPERIMENTAL) public Iterator<? extends ExpressionRef<? extends PlannerExpression>> getPlannerExpressionChildren()
PlannerExpression
Collections.emptyIterator()
is returned. The returned iterator should
be treated as an immutable object and may throw an exception if Iterator.remove()
is called.
The iterator must return its elements in a consistent order.getPlannerExpressionChildren
in interface PlannerExpression
public boolean equals(Object o)
public int hashCode()
public int planHash()
PlanHashable
hashCode
, but with the additional guarantee that is is stable across JVMs.planHash
in interface PlanHashable
@Nullable protected List<Object> getValues(@Nonnull MessageOrBuilder message)
@Nonnull protected Descriptors.FieldDescriptor validateRepeatedField(@Nonnull Descriptors.Descriptor descriptor)
@Nonnull protected Descriptors.FieldDescriptor findFieldDescriptor(@Nonnull MessageOrBuilder message)
@Nullable protected Object getFieldValue(@Nullable MessageOrBuilder message)
@Nonnull protected Descriptors.FieldDescriptor validateFieldExistence(@Nonnull Descriptors.Descriptor descriptor)
protected void requirePrimitiveField(@Nonnull Descriptors.FieldDescriptor field)
protected void requireMessageField(@Nonnull Descriptors.FieldDescriptor field)
protected void requireScalarField(@Nonnull Descriptors.FieldDescriptor field)