BUG-2377: introduce internal UnmodifiableChildrenMap 15/12815/4
authorRobert Varga <rovarga@cisco.com>
Thu, 13 Nov 2014 13:47:26 +0000 (14:47 +0100)
committerRobert Varga <rovarga@cisco.com>
Sun, 16 Nov 2014 13:52:26 +0000 (14:52 +0100)
commit59d197fc60bccd1fef2e3bef39c859f12a9c1ae8
tree45c6e06265f4ade0cae6757b902db9018cbbdc33
parent2b2759df79c2837bc1ada2f720370d508480e01c
BUG-2377: introduce internal UnmodifiableChildrenMap

This new class acts a replacement of java.util.Collection's version of
the same. Unlike the standard class, this one does not retain cached
versions of keySet and entrySet, since those are unused anyway. We can
also perform an instanceof check, which should speed up operations.
Finally, we check for map emptiness and use Collections.emptyMap()
when possible.

Change-Id: I84c8ac428d6b207fafccf8cc898f0555b104a4ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/UnmodifiableChildrenMap.java [new file with mode: 0644]