Add utility methods to strip zone from Ipv{4,6}Address 91/86791/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 7 Jan 2020 11:25:33 +0000 (12:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 7 Jan 2020 13:14:44 +0000 (14:14 +0100)
commitd7d5e5f1b4e7a5a25125d6989e7ddd9f81234f21
tree3e7eec25408e00766f6d470eb1b1afc16d05c52c
parent2250cb68002d1c3c6a93d2786731694b6f82d510
Add utility methods to strip zone from Ipv{4,6}Address

Most callers really want to operate of Ipv4AddressNoZone, as a zone
does not make sense. Some amount of translation may be needed when
dealing with models which we have no control over, hence ensuring
no zone is present needs to be done quickly.

This adds ipv4AddressNoZoneFor(Ipv4Address), which does an efficient
check (for the case where the source is already a NoZone) and strips
the zone.

Change-Id: Ieada4625637d0216983b515324bb5d33f5d33a99
JIRA: MDSAL-510
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6c02ae5ce070dfeeeaae878dc5436c601d305886)
model/ietf/ietf-type-util/src/main/java/org/opendaylight/mdsal/model/ietf/util/AbstractIetfInetUtil.java
model/ietf/rfc6991-ietf-inet-types/src/test/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IetfInetUtilTest.java