Add YangInstanceIdentifier.coerceParent() 07/90307/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:31:03 +0000 (18:31 +0200)
commit71a43cae5daaad218940cf8e173676c767453409
tree0d06b3374c9752c6e9688c5d4e53c23c8d0ccb43
parente7b5031971093c0f48d1cf6c35e7b80886a157b7
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