Class AndComponent
- java.lang.Object
-
- com.apple.foundationdb.record.query.expressions.AndOrComponent
-
- com.apple.foundationdb.record.query.expressions.AndComponent
-
- All Implemented Interfaces:
PlanHashable
,ComponentWithChildren
,QueryComponent
@API(MAINTAINED) public class AndComponent extends AndOrComponent
AQueryComponent
that is satisfied when all of its child components are satisfied. For tri-valued logic:- If all children are
true
, thentrue
. - If any child is
false
, thenfalse
. - Else
null
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.PlanHashable
PlanHashable.PlanHashKind
-
-
Constructor Summary
Constructors Constructor Description AndComponent(List<QueryComponent> operands)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 equivalentQueryPredicate
by pushing all information about nested and repeated fields toElement
s inside ofElementPredicate
s.int
planHash(PlanHashable.PlanHashKind hashKind)
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.String
toString()
void
validate(Descriptors.Descriptor descriptor)
QueryComponent
withOtherChildren(List<QueryComponent> newChildren)
-
Methods inherited from class com.apple.foundationdb.record.query.expressions.AndOrComponent
evalMessage, evalMessageAsync, isAsync, normalizeChildrenForPlanner
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.query.expressions.ComponentWithChildren
getChildren
-
Methods inherited from interface com.apple.foundationdb.record.PlanHashable
planHash
-
Methods inherited from interface com.apple.foundationdb.record.query.expressions.QueryComponent
eval, evalAsync, normalizeForPlanner, validate
-
-
-
-
Constructor Detail
-
AndComponent
public AndComponent(@Nonnull List<QueryComponent> operands)
-
-
Method Detail
-
from
@Nonnull public static AndComponent from(@Nonnull List<? extends QueryComponent> operands)
-
isOr
public boolean isOr()
- Specified by:
isOr
in classAndOrComponent
-
withOtherChildren
public QueryComponent withOtherChildren(List<QueryComponent> newChildren)
-
normalizeForPlanner
@Nonnull public QueryPredicate normalizeForPlanner(@Nonnull Source source, @Nonnull List<String> fieldNamePrefix)
Description copied from interface:QueryComponent
Convert this query component into an equivalentQueryPredicate
by pushing all information about nested and repeated fields toElement
s inside ofElementPredicate
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 theElementPredicate
at the leaves of the sub-tree rooted at that nested field. This extra information is tracked in the givenfieldNamePrefix
.- Parameters:
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 component- Returns:
- an equivalent query predicate
-
planHash
public int planHash(@Nonnull PlanHashable.PlanHashKind hashKind)
Description copied from interface:PlanHashable
Return a hash similar tohashCode
, but with the additional guarantee that is is stable across JVMs.- Parameters:
hashKind
- the "kind" of hash to calculate. Each kind of hash has a particular logic with regards to included and excluded items.- Returns:
- a stable hash code
-
validate
public void validate(@Nonnull Descriptors.Descriptor descriptor)
-
getChildren
@Nonnull public List<QueryComponent> getChildren()
Children for this component, at least 2 of them.- Returns:
- the children of this component
-
-