Add support for keyed entries 51/93451/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Oct 2020 22:54:40 +0000 (23:54 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 28 Oct 2020 11:12:11 +0000 (12:12 +0100)
commit3ad384b7dccb243d8fbfce398c682846fe3609e6
tree808af13baec3af4a005f6303a3039f810a238cd3
parent95c1089e54bda84eb44a72312f388fcd811027d4
Add support for keyed entries

When we enter a NodeIdentifierWithPredicates for a Map, we can
service that with a direct map lookup instead of iteration. As we
now have the tools to access this step, add a unit test and fix
the implementation.

These predicates add another dimension to matching, where we have
to deal with Maps, something that NormalizedNodes does not help
with.

Predicate matching is split into its own class with a clear entry
point, so as to separate it from other complex pieces. This also
solves the tension between Evaluator and Iterator by shifting
ownership to a third class.

Since a predicate now be matching multiple nodes, we have to also
introduce an explicit DOMQueryPredicate.Not, so that its effects
can be properly accounted for.

JIRA: MDSAL-612
Change-Id: I34511517c5746efc5d245a56da89083c44100752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d0e3e6654cc79d3725263b1f0ecfa2d79c2a3e47)
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/query/AbstractValueMatchBuilder.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/query/QueryBuilderTest.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/query/DOMQueryPredicate.java
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/query/DOMQueryEvaluator.java
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/query/DOMQueryMatcher.java [new file with mode: 0644]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/query/LazyDOMQueryResultIterator.java