Remove use of getKeyValues()
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Jun 2019 10:32:26 +0000 (12:32 +0200)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:28 +0000 (10:41 +1000)
This adjusts callers of deprecated method, fixing warnings and
allowing better integration in future.

Change-Id: I6f5bb82af22cfa94e7c532f596c813058b3511d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/IdentifiableItemCodec.java
binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/InstanceIdentifierSerializeDeserializeTest.java

index 2f420ebe318975e21de53bdbc538ad9ccd88c756..4c1ea58eaa3e117e793210dd52605da0814a2c73 100644 (file)
@@ -161,7 +161,7 @@ abstract class IdentifiableItemCodec implements Codec<NodeIdentifierWithPredicat
     @SuppressWarnings("checkstyle:illegalCatch")
     final @NonNull Identifier<?> deserializeIdentifier(final NodeIdentifierWithPredicates input) {
         try {
-            return deserializeIdentifier(input.getKeyValues());
+            return deserializeIdentifier(input.asMap());
         } catch (Throwable e) {
             Throwables.throwIfUnchecked(e);
             throw new IllegalStateException("Failed to deserialize " + input, e);
index b7434ac90ad56a2b3a59da2bab699c628a936370..3b765e47fbc83d6e966669aa32d538875f8df949 100644 (file)
@@ -106,8 +106,7 @@ public class InstanceIdentifierSerializeDeserializeTest extends AbstractBindingC
                 InstanceIdentifier.create(Top.class).child(TopLevelList.class, TOP_FOO_KEY));
         final PathArgument lastPathArgument = yangInstanceIdentifier.getLastPathArgument();
         assertTrue(lastPathArgument instanceof NodeIdentifierWithPredicates);
-        assertTrue(((NodeIdentifierWithPredicates) lastPathArgument).getKeyValues().containsValue(
-            TOP_LEVEL_LIST_KEY_VALUE));
+        assertTrue(((NodeIdentifierWithPredicates) lastPathArgument).values().contains(TOP_LEVEL_LIST_KEY_VALUE));
         assertEquals(TopLevelList.QNAME, lastPathArgument.getNodeType());
     }