Class AnyChildWithRestMatcher
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.matchers.AnyChildWithRestMatcher
-
- All Implemented Interfaces:
ExpressionChildrenMatcher
@API(EXPERIMENTAL) public class AnyChildWithRestMatcher extends Object implements ExpressionChildrenMatcher
An expression matcher that tries to match any child to the givenExpressionMatcher
while providing aReferenceMatcher
binding to all other children. This can be quite useful when matching to a planner expression that might have an unbounded number of children when a planner rule wants to inspect exactly one of those children deeply. This matcher might produce several possible bindings because theExpressionMatcher
for the distinguished child might match several children.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Bindable>
AnyChildWithRestMatcheranyMatchingWithRest(ExpressionMatcher<? extends QueryPredicate> selectedChildMatcher, ExpressionMatcher<QueryPredicate> otherChildrenMatcher)
Stream<PlannerBindings>
matches(PlannerBindings outerBindings, List<? extends Bindable> children)
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings.
-
-
-
Method Detail
-
matches
@Nonnull public Stream<PlannerBindings> matches(@Nonnull PlannerBindings outerBindings, @Nonnull List<? extends Bindable> children)
Description copied from interface:ExpressionChildrenMatcher
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings. If the match is not successful, produce an empty stream. Note that this method should not generally match to the children themselves; instead, it should delegate that work to one or more innerExpressionMatcher
s.- Specified by:
matches
in interfaceExpressionChildrenMatcher
- Parameters:
outerBindings
- preexisting bindings supplied by the callerchildren
- a list of references to the children of a planner expression- Returns:
- a stream of the possible bindings from applying this match to the children in the given iterator
-
anyMatchingWithRest
@Nonnull public static <T extends Bindable> AnyChildWithRestMatcher anyMatchingWithRest(@Nonnull ExpressionMatcher<? extends QueryPredicate> selectedChildMatcher, @Nonnull ExpressionMatcher<QueryPredicate> otherChildrenMatcher)
-
-