Refactor RouteDistinguisherUtil 03/86703/2
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 5 Jan 2020 08:06:24 +0000 (09:06 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 5 Jan 2020 08:32:03 +0000 (09:32 +0100)
commit29fd3e6786498a9f8cdd157c3186bcefed810824
tree1ad0e0882f295754f72ceb5a135993aa4227f29e
parent74d55717c1878176fd88ffe806540a6419212ccb
Refactor RouteDistinguisherUtil

This class is using deprecated ByteBufWriteUtils methods and this
patch refactors it not to, as it only brings invariant checks
to the table.

Serialize method made a dispatcher between the three distinct
implementations.

Each implementation is refactored to first check string validity
by searching for separators -- which is done faster than previous
String.split(String). Only after validation are parts split
and pushed to the buffer.

Change-Id: Ie87fbaf042d75176c584bf15e345c463b4c747f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/concepts/src/main/java/org/opendaylight/bgp/concepts/RouteDistinguisherUtil.java
bgp/concepts/src/test/java/org/opendaylight/bgp/concepts/RouteDistinguisherUtilTest.java