Add DistinctNodeContainer.getChildByArg() 32/96532/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 15 Jun 2021 17:30:06 +0000 (19:30 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 15 Jun 2021 17:30:06 +0000 (19:30 +0200)
commit14d75b85a76fb2d67ec425b5e681c226fcf63097
treead82b2b7df5c43b6372648b7416a52090712da27
parentbaa774387a45184cc890aac3e2d1132b4ada85ee
Add DistinctNodeContainer.getChildByArg()

There are a number of places where there is an implied assertion
that the child must exist, but the caller does not care about the
exception being reported.  These are using
findChildByArg().orElseThrows() today, could use a more expressive
alternative.

Add getChildByArg() as a default method, which wraps a call to
childByArg() with a verifyNotNull(), neatly expressing the intent.

Change-Id: I8dade860a0c615e987aa2c017473eb08769afee3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
data/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DistinctNodeContainer.java