*/
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(
}
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())
}
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();
}