Add YangInstanceIdentifier.coerceParent() 05/90305/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 15:45:37 +0000 (17:45 +0200)
commit3c488d8405b860834471acc96e7c562156a1c777
treebb6ef8906f5bb461f757e7d4890874f18d27e0d0
parent94336a79d974543e50cd5e9047d6bd148e4ddbda
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>
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