@Test public void testSingleFieldEquality() { final QueryToKeyMatcher matcher = new QueryToKeyMatcher(queryField("a").equalsValue(7)); Match match = matcher.matchesSatisfyingQuery(keyField("a")); assertEquals(MatchType.EQUALITY, match.getType()); assertEquals(Key.Evaluated.scalar(7), match.getEquality()); match = matcher.matchesSatisfyingQuery(concatenateFields("a", "b")); assertEquals(MatchType.EQUALITY, match.getType()); assertEquals(Key.Evaluated.scalar(7), match.getEquality()); assertNoMatch(matcher.matchesSatisfyingQuery(keyField("b"))); assertNoMatch(matcher.matchesSatisfyingQuery(keyField("a", FanType.FanOut))); assertNoMatch(matcher.matchesSatisfyingQuery(keyField("a", FanType.Concatenate))); assertNoMatch(matcher.matchesSatisfyingQuery(keyField("b").nest("a"))); assertNoMatch(matcher.matchesSatisfyingQuery(keyField("a").nest("b"))); assertNoMatch(matcher.matchesSatisfyingQuery(concatenateFields("b", "a"))); }
@Nonnull public Match matchesSatisfyingQuery(@Nonnull KeyExpression expression) { return matchesSatisfyingQuery(expression, null); }
QueryToKeyMatcher { @Nonnull public Match matchesSatisfyingQuery(@Nonnull KeyExpression expression) { return matchesSatisfyingQuery(expression, null); } }
QueryToKeyMatcher { @Nonnull public Match matchesSatisfyingQuery(@Nonnull KeyExpression expression) { return matchesSatisfyingQuery(expression, null); } QueryToKeyMatcher(@Nonnull QueryComponent rootQuery); }
QueryToKeyMatcher { @Nonnull public Match matchesSatisfyingQuery(@Nonnull KeyExpression expression) { return matchesSatisfyingQuery(expression, null); } QueryToKeyMatcher(@Nonnull QueryComponent rootQuery); @Nonnull Match matchesCoveringKey(@Nonnull KeyExpression expression); @Nonnull Match matchesCoveringKey(@Nonnull KeyExpression expression, @Nullable FilterSatisfiedMask filterMask); @Nonnull Match matchesSatisfyingQuery(@Nonnull KeyExpression expression); @Nonnull Match matchesSatisfyingQuery(@Nonnull KeyExpression expression, @Nullable FilterSatisfiedMask filterMask); @Nonnull @Deprecated Match matches(@Nonnull KeyExpression expression); }
QueryToKeyMatcher { @Nonnull public Match matchesSatisfyingQuery(@Nonnull KeyExpression expression) { return matchesSatisfyingQuery(expression, null); } QueryToKeyMatcher(@Nonnull QueryComponent rootQuery); @Nonnull Match matchesCoveringKey(@Nonnull KeyExpression expression); @Nonnull Match matchesCoveringKey(@Nonnull KeyExpression expression, @Nullable FilterSatisfiedMask filterMask); @Nonnull Match matchesSatisfyingQuery(@Nonnull KeyExpression expression); @Nonnull Match matchesSatisfyingQuery(@Nonnull KeyExpression expression, @Nullable FilterSatisfiedMask filterMask); @Nonnull @Deprecated Match matches(@Nonnull KeyExpression expression);  }