Migrate NodeIdentifierWithPredicates users 36/84236/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 6 Sep 2019 06:45:44 +0000 (08:45 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 6 Sep 2019 06:50:47 +0000 (08:50 +0200)
Constructors have been deprecated, as well as getKeyValues().
Migrate to their replacements.

Change-Id: Iaf25f19a0debc62db23be23d3003eb863fde6b53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/IdentifierUtils.java
bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/RibSupportUtilsTest.java

index 0ceca75b76a3e61baf120e1349ac7cda31962849..6b4decc5c92f3dcaf11fdfb58af8f18bd7af68b5 100644 (file)
@@ -59,7 +59,7 @@ public final class IdentifierUtils {
 
     public static PeerId peerId(final NodeIdentifierWithPredicates peerKey) {
         // We could use a codec, but this is simple enough
-        return new PeerId((String) peerKey.getKeyValues().get(PEER_ID));
+        return new PeerId((String) peerKey.getValue(PEER_ID));
     }
 
     public static PeerId peerKeyToPeerId(final YangInstanceIdentifier id) {
@@ -72,6 +72,6 @@ public final class IdentifierUtils {
     }
 
     public static NodeIdentifierWithPredicates domPeerId(final PeerId peer) {
-        return new NodeIdentifierWithPredicates(Peer.QNAME, PEER_ID_TEMPLATE.instantiateWithValue(peer.getValue()));
+        return NodeIdentifierWithPredicates.of(Peer.QNAME, PEER_ID_TEMPLATE.instantiateWithValue(peer.getValue()));
     }
 }
index e74e7b89b6326fa029d1a017b8e700706cf023d5..30e39767762903ab8a9b1fb68fdd2e0f73e51c60 100644 (file)
@@ -50,7 +50,7 @@ public class RibSupportUtilsTest {
     @Test
     public void testYangTablesKey() {
         final NodeIdentifierWithPredicates p = RibSupportUtils.toYangTablesKey(TABLE_KEY);
-        final Map<QName, Object> m = p.getKeyValues();
+        final Map<QName, Object> m = p.asMap();
         assertFalse(m.isEmpty());
         assertEquals(Tables.QNAME, p.getNodeType());
         assertTrue(m.containsValue(BindingReflections.findQName(AFI)));
@@ -60,7 +60,7 @@ public class RibSupportUtilsTest {
     @Test
     public void testYangKey() {
         final NodeIdentifierWithPredicates p = RibSupportUtils.toYangKey(SupportedTables.QNAME, TABLE_KEY);
-        final Map<QName, Object> m = p.getKeyValues();
+        final Map<QName, Object> m = p.asMap();
         assertFalse(m.isEmpty());
         assertEquals(SupportedTables.QNAME, p.getNodeType());
         assertTrue(m.containsValue(BindingReflections.findQName(AFI)));