Add UniqueValidation
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / ListModificationStrategy.java
index 4bfed11edd9beeb00cb98495fa7a2f17a526d508..c8018ae90be94d9cc3438022d3ff74da05830e61 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
 
+import com.google.common.base.MoreObjects.ToStringHelper;
 import java.util.Optional;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
@@ -74,22 +75,20 @@ final class ListModificationStrategy extends SchemaAwareApplyOperation<ListSchem
         }
 
         /*
-         * This is where things get interesting. The user has performed a write and
-         * then she applied some more modifications to it. So we need to make sense
-         * of that an apply the operations on top of the written value. We could have
-         * done it during the write, but this operation is potentially expensive, so
-         * we have left it out of the fast path.
+         * This is where things get interesting. The user has performed a write and then she applied some more
+         * modifications to it. So we need to make sense of that an apply the operations on top of the written value. We
+         * could have done it during the write, but this operation is potentially expensive, so we have left it out of
+         * the fast path.
          *
-         * As it turns out, once we materialize the written data, we can share the
-         * code path with the subtree change. So let's create an unsealed TreeNode
-         * and run the common parts on it -- which end with the node being sealed.
+         * As it turns out, once we materialize the written data, we can share the code path with the subtree change. So
+         * let's create an unsealed TreeNode and run the common parts on it -- which end with the node being sealed.
          */
         final MutableTreeNode mutable = newValueMeta.mutable();
         mutable.setSubtreeVersion(version);
 
         @SuppressWarnings("rawtypes")
-        final NormalizedNodeContainerBuilder dataBuilder = ImmutableUnkeyedListEntryNodeBuilder
-            .create((UnkeyedListEntryNode) newValue);
+        final NormalizedNodeContainerBuilder dataBuilder =
+            ImmutableUnkeyedListEntryNodeBuilder.create((UnkeyedListEntryNode) newValue);
 
         return mutateChildren(mutable, dataBuilder, version, modification.getChildren());
     }
@@ -153,4 +152,9 @@ final class ListModificationStrategy extends SchemaAwareApplyOperation<ListSchem
         // Unkeyed lists are always replaced
         node.write(value);
     }
+
+    @Override
+    ToStringHelper addToStringAttributes(final ToStringHelper helper) {
+        return helper.add("entry", entryStrategy);
+    }
 }