Use NormalizedNode streaming serialization in sal-remoterpc-connector
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / serialization / ValueType.java
index 9eec8a300a81f2fc304beb7d9978ec7aef26b331..fe0c97b77f2bb8bf70a9df629719cef83c972b2b 100644 (file)
@@ -109,7 +109,6 @@ public enum ValueType {
         b.put(Long.class, LONG_TYPE);
         b.put(Boolean.class, BOOL_TYPE);
         b.put(QName.class, QNAME_TYPE);
-        b.put(YangInstanceIdentifier.class, YANG_IDENTIFIER_TYPE);
         b.put(Short.class,SHORT_TYPE);
         b.put(BigInteger.class, BIG_INTEGER_TYPE);
         b.put(BigDecimal.class, BIG_DECIMAL_TYPE);
@@ -121,7 +120,7 @@ public enum ValueType {
     abstract Object deserialize(String str);
 
     public static final ValueType getSerializableType(Object node) {
-        if(node == null){
+        if (node == null) {
             return NULL_TYPE;
         }
 
@@ -133,6 +132,10 @@ public enum ValueType {
             return BITS_TYPE;
         }
 
+        if (node instanceof YangInstanceIdentifier) {
+            return YANG_IDENTIFIER_TYPE;
+        }
+
         throw new IllegalArgumentException("Unknown value type " + node.getClass().getSimpleName());
     }
 }