Improve ListEntryNodeDataWithSchema 00/78100/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 22 Nov 2018 22:32:00 +0000 (23:32 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 23 Nov 2018 16:53:20 +0000 (17:53 +0100)
commit27cb0ab92721e17a14dea60fcfee8bb9a0e0ae4b
treee766fa01bd52277a2f4e9dec14b12d7887139e62
parent6ce1221b48e7ef7ac6ef0d439ee8ec127565bf12
Improve ListEntryNodeDataWithSchema

ImmutableMapTemplate allows us to more efficiently instantiate
NodeIdentifierPredicates, as it takes care of ordering of keys
while maintaining an efficient internal representations.

It furthermore provides a keySet() method, which is useful for
quickly checking if a leaf is part of key definition -- unlike
ListSchemaNode.getKeyDefinition(), which is a List and therefore
must be linearly searched.

It also allows us to skip HashMap allocation for unkeyed lists,
clearly showing that the class should be split into two.

JIRA: YANGTOOLS-917
Change-Id: If2d7bbbc5c4fe1ca96097f374f4313aabb411908
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e31b3dc700002b19d92ecc68463ab2711d8af99c)
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/ListEntryNodeDataWithSchema.java