Bump mdsal to 4.0.0
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / LazyDataTreeModification.java
index 2a90f96646a7733056353f898beca3c08bdf3770..0ec5aa7154cbfd3224583c4cd2fd01c00947141b 100644 (file)
@@ -15,7 +15,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingDataObjectCodecTreeNode;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
@@ -33,7 +33,8 @@ class LazyDataTreeModification<T extends DataObject> implements DataTreeModifica
     private final DataTreeIdentifier<T> path;
     private final DataObjectModification<T> rootNode;
 
-    LazyDataTreeModification(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> path, final BindingCodecTreeNode<T> codec, final DataTreeCandidate domChange) {
+    LazyDataTreeModification(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> path,
+            final BindingDataObjectCodecTreeNode<T> codec, final DataTreeCandidate domChange) {
         this.path = new DataTreeIdentifier<>(datastoreType, path);
         this.rootNode = LazyDataObjectModification.create(codec, domChange.getRootNode());
     }
@@ -49,11 +50,11 @@ class LazyDataTreeModification<T extends DataObject> implements DataTreeModifica
     }
 
     @SuppressWarnings({"unchecked", "rawtypes"})
-    static <T extends DataObject> DataTreeModification<T> create(final BindingToNormalizedNodeCodec codec, final DataTreeCandidate domChange,
-            final LogicalDatastoreType datastoreType) {
-        final Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>> codecCtx =
+    static <T extends DataObject> DataTreeModification<T> create(final BindingToNormalizedNodeCodec codec,
+            final DataTreeCandidate domChange, final LogicalDatastoreType datastoreType) {
+        final Entry<InstanceIdentifier<?>, BindingDataObjectCodecTreeNode<?>> codecCtx =
                 codec.getSubtreeCodec(domChange.getRootPath());
-        return (DataTreeModification<T>) new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
+        return new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
     }
 
     static <T extends DataObject> Collection<DataTreeModification<T>> from(final BindingToNormalizedNodeCodec codec,
@@ -65,4 +66,8 @@ class LazyDataTreeModification<T extends DataObject> implements DataTreeModifica
         return result;
     }
 
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + "{path = " + path + ", rootNode = " + rootNode + "}";
+    }
 }