@API(value=MAINTAINED) public class AndComponent extends AndOrComponent
QueryComponent
that is satisfied when all of its child components are satisfied.
For tri-valued logic:
true
, then true
.false
, then false
.null
.Constructor and Description |
---|
AndComponent(List<QueryComponent> operands) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static AndComponent |
from(List<? extends QueryComponent> operands) |
List<QueryComponent> |
getChildren()
Children for this component, at least 2 of them.
|
int |
hashCode() |
boolean |
isOr() |
QueryPredicate |
normalizeForPlanner(Source source,
List<String> fieldNamePrefix)
Convert this query component into an equivalent
QueryPredicate by pushing all information about nested
and repeated fields to Element s inside of ElementPredicate s. |
int |
planHash()
Return a hash similar to
hashCode , but with the additional guarantee that is is stable across JVMs. |
String |
toString() |
void |
validate(Descriptors.Descriptor descriptor) |
QueryComponent |
withOtherChildren(List<QueryComponent> newChildren) |
evalMessage, evalMessageAsync, isAsync, normalizeChildrenForPlanner
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildren
eval, evalAsync, normalizeForPlanner, validate
combineHashes, iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash, planHashUnordered, stringHashUnordered
public AndComponent(@Nonnull List<QueryComponent> operands)
@Nonnull public static AndComponent from(@Nonnull List<? extends QueryComponent> operands)
public boolean isOr()
isOr
in class AndOrComponent
public QueryComponent withOtherChildren(List<QueryComponent> newChildren)
@Nonnull public QueryPredicate normalizeForPlanner(@Nonnull Source source, @Nonnull List<String> fieldNamePrefix)
QueryComponent
QueryPredicate
by pushing all information about nested
and repeated fields to Element
s inside of ElementPredicate
s.
This normalization process requires tracking some state: the name of a nested field is available
only at the relevant NestedField
, but that information is necessary to construct the
ElementPredicate
at the leaves of the sub-tree rooted at
that nested field. This extra information is tracked in the given fieldNamePrefix
.
source
- the source representing the input stream of the key expressionfieldNamePrefix
- the (non-repeated) field names on the path from the most recent source to this part of the query componentpublic int planHash()
PlanHashable
hashCode
, but with the additional guarantee that is is stable across JVMs.public void validate(@Nonnull Descriptors.Descriptor descriptor)
@Nonnull public List<QueryComponent> getChildren()