Improve ListEntryNodeDataWithSchema 66/78066/16
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 10:14:08 +0000 (11:14 +0100)
commite31b3dc700002b19d92ecc68463ab2711d8af99c
tree60e84bdfa0894fd094cf74b59d78325870efe019
parent048042bd88cc9b1f481c018363c331bca83e4e1f
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>
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/ListEntryNodeDataWithSchema.java