Migrate some tests to new ImmutableNodes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / md / cluster / datastore / model / PeopleModel.java
index ee2a416cbc5ab37e1f29e5b08591ae25f05fc0e9..725faf56f1e5663eb66c9936738495e9683167d3 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.controller.md.cluster.datastore.model;
 
+import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.mapEntryBuilder;
+
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
-import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
-import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
+import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes;
 
 public final class PeopleModel {
     public static final QName BASE_QNAME = QName.create(
@@ -33,17 +34,17 @@ public final class PeopleModel {
     }
 
     public static ContainerNode create() {
-        return Builders.containerBuilder()
+        return ImmutableNodes.newContainerBuilder()
             .withNodeIdentifier(new NodeIdentifier(BASE_QNAME))
-            .withChild(Builders.mapBuilder()
+            .withChild(ImmutableNodes.newSystemMapBuilder()
                 .withNodeIdentifier(new NodeIdentifier(PERSON_QNAME))
                 // Create an entry for the person jack
-                .withChild(ImmutableNodes.mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jack")
+                .withChild(mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jack")
                     .withChild(ImmutableNodes.leafNode(PERSON_NAME_QNAME, "jack"))
                     .withChild(ImmutableNodes.leafNode(PERSON_AGE_QNAME, 100L))
                     .build())
                 // Create an entry for the person jill
-                .withChild(ImmutableNodes.mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jill")
+                .withChild(mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, "jill")
                     .withChild(ImmutableNodes.leafNode(PERSON_NAME_QNAME, "jill"))
                     .withChild(ImmutableNodes.leafNode(PERSON_AGE_QNAME, 200L))
                     .build())
@@ -52,17 +53,15 @@ public final class PeopleModel {
     }
 
     public static ContainerNode emptyContainer() {
-        return Builders.containerBuilder()
-            .withNodeIdentifier(new NodeIdentifier(BASE_QNAME))
-            .build();
+        return ImmutableNodes.newContainerBuilder().withNodeIdentifier(new NodeIdentifier(BASE_QNAME)).build();
     }
 
     public static SystemMapNode newPersonMapNode() {
-        return ImmutableNodes.mapNodeBuilder(PERSON_QNAME).build();
+        return ImmutableNodes.newSystemMapBuilder().withNodeIdentifier(new NodeIdentifier(PERSON_QNAME)).build();
     }
 
     public static MapEntryNode newPersonEntry(final String name) {
-        return ImmutableNodes.mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, name)
+        return mapEntryBuilder(PERSON_QNAME, PERSON_NAME_QNAME, name)
             .withChild(ImmutableNodes.leafNode(PERSON_NAME_QNAME, name))
             .build();
     }