@API(value=EXPERIMENTAL) public class AllChildrenMatcher extends Object implements ExpressionChildrenMatcher
ExpressionMatcher
.
Given a single ExpressionMatcher
, this matcher tries to match it to every child. If it matches all of them, it
produces a stream of bindings containing the Cartesian product of the streams of bindings from each child, merged
using PlannerBindings.mergedWith(PlannerBindings)
. Because the same matcher is used for all children, the
merged bindings will map the single child matcher to a collected list of Bindable
s; such a binding must be
retrieved using PlannerBindings.getAll(ExpressionMatcher)
rather than the usual get()
method.Modifier and Type | Method and Description |
---|---|
static AllChildrenMatcher |
allMatching(ExpressionMatcher<? extends Bindable> childMatcher)
Get a matcher that tries to match all children with the given
ExpressionMatcher . |
Stream<PlannerBindings> |
matches(Iterator<? extends ExpressionRef<? extends PlannerExpression>> childIterator)
Apply this matcher to the children provided by the given iterator and produce a stream of possible bindings.
|
@Nonnull public Stream<PlannerBindings> matches(@Nonnull Iterator<? extends ExpressionRef<? extends PlannerExpression>> childIterator)
ExpressionChildrenMatcher
ExpressionMatcher
s.matches
in interface ExpressionChildrenMatcher
childIterator
- an iterator of references to the children of a planner expression@Nonnull public static AllChildrenMatcher allMatching(@Nonnull ExpressionMatcher<? extends Bindable> childMatcher)
ExpressionMatcher
.childMatcher
- an expression matcher to match all of the children