Return Ipv{4,6}AddressNoZone when formatting from binary 89/86789/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 7 Jan 2020 12:57:43 +0000 (13:57 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 7 Jan 2020 13:13:02 +0000 (14:13 +0100)
commitb32e2ed3958c68357ff60800e3450e69aef02b73
treecf2720e83df3eaaa10f9d42468f720b3ce8f8207
parent6c02ae5ce070dfeeeaae878dc5436c601d305886
Return Ipv{4,6}AddressNoZone when formatting from binary

Ever since MDSAL-440 was implemented, there is no point in our
utilities returning Ipv4Address objects as they never contain a zone
and therefore are equivalent to Ipv4AddressNoZone.

Ipv4AddressNoZone has the additional benefit that the lack of a zone
is contained in the type definition -- hence it can be propagated
through Java interfaces in a type-safe manner. Futhermore, given
the relationship between the two classes, the non-presence of zone
can be ascertained via a simple instanceof check rather than
searching the string.

JIRA: MDSAL-511
Change-Id: I7e0ed85bad7a63af9e9a6f8838609c0e53776ab0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/ietf/ietf-type-util/src/main/java/org/opendaylight/mdsal/model/ietf/util/AbstractIetfInetUtil.java
model/ietf/ietf-type-util/src/test/java/org/opendaylight/mdsal/model/ietf/util/IpUtil.java
model/ietf/rfc6991-ietf-inet-types/src/main/java/org/opendaylight/yang/gen/v1/urn/ietf/params/xml/ns/yang/ietf/inet/types/rev130715/IetfInetUtil.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