Add YangInstanceIdentifier.coerceParent() 06/90306/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 5 Jun 2020 15:41:08 +0000 (17:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 5 Jun 2020 16:30:53 +0000 (18:30 +0200)
commit1ae72465197298f5dab249564cbd47569e6b4ef9
treedf18b9131b00b52dd35e4f8ffeb4a74935c80059
parentb67f19b2bc2ac96ef94e3360b3fb188db6b49670
Add YangInstanceIdentifier.coerceParent()

There are a number of YangInstanceIdentifier users who perform
checks (or otherwise ensure) that YangInstanceIdentifier they are
dealing with is non-empty and hence its getParent() method cannot
possibly return null. These users still interact with methods
which explicitly require a non-null YangInstanceIdentifier -- hence
it would be useful to provide a bridge method which performs this
validation.

Change-Id: I7acb4b04ccbe3c536b690573519171af32089d41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3c488d8405b860834471acc96e7c562156a1c777)
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/FixedYangInstanceIdentifier.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/StackedYangInstanceIdentifier.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java