Cleanup StringModuleInstanceIdentifierCodec a bit 07/97207/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 13 Aug 2021 19:25:23 +0000 (21:25 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 13 Aug 2021 19:49:47 +0000 (21:49 +0200)
commit63eba7f355bacfe2aa1f20112cf2a7f98bd2928c
treed98f5ea6489a0ad5e92fc8b98daeb16f9d4e1ecb
parent96f7049b19b910561cce75d1b27e950c86dbd5df
Cleanup StringModuleInstanceIdentifierCodec a bit

Compact the implementation a bit by reusing code paths. Also we do not
really allow null defaultPrefix, but check for it being empty.

Make this.defaultPrefix nullable, which allows us to simplify the check
in moduleForPrefix() down to a simple null check.

JIRA: NETCONF-804
Change-Id: Ifa01017613761466a32e371d56b0bb6521145115
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/codecs/StringModuleInstanceIdentifierCodec.java