*/
package org.opendaylight.controller.md.cluster.datastore.model;
-import java.math.BigInteger;
import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint64;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
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.MapNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode;
+import org.opendaylight.yangtools.yang.data.api.schema.builder.CollectionNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMapNodeBuilder;
}
- public static NormalizedNode<?, ?> create() {
+ public static ContainerNode create() {
// Create a list builder
- CollectionNodeBuilder<MapEntryNode, MapNode> cars =
+ CollectionNodeBuilder<MapEntryNode, SystemMapNode> cars =
ImmutableMapNodeBuilder.create().withNodeIdentifier(
- new YangInstanceIdentifier.NodeIdentifier(
- CAR_QNAME));
+ new YangInstanceIdentifier.NodeIdentifier(CAR_QNAME));
// Create an entry for the car altima
MapEntryNode altima =
ImmutableNodes.mapEntryBuilder(CAR_QNAME, CAR_NAME_QNAME, "altima")
.withChild(ImmutableNodes.leafNode(CAR_NAME_QNAME, "altima"))
- .withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, new BigInteger("1000")))
+ .withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, Uint64.valueOf(1000)))
.build();
// Create an entry for the car accord
MapEntryNode honda =
ImmutableNodes.mapEntryBuilder(CAR_QNAME, CAR_NAME_QNAME, "accord")
.withChild(ImmutableNodes.leafNode(CAR_NAME_QNAME, "accord"))
- .withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, new BigInteger("2000")))
+ .withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, Uint64.valueOf("2000")))
.build();
cars.withChild(altima);
}
- public static NormalizedNode<?, ?> createEmptyCarsList() {
+ public static NormalizedNode createEmptyCarsList() {
return newCarsNode(newCarsMapNode());
}
}
public static MapNode newCarsMapNode(final MapEntryNode... carEntries) {
- CollectionNodeBuilder<MapEntryNode, MapNode> builder = ImmutableMapNodeBuilder.create()
+ CollectionNodeBuilder<MapEntryNode, SystemMapNode> builder = ImmutableMapNodeBuilder.create()
.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CAR_QNAME));
for (MapEntryNode e : carEntries) {
builder.withChild(e);
return builder.build();
}
- public static NormalizedNode<?, ?> emptyContainer() {
+ public static ContainerNode emptyContainer() {
return ImmutableContainerNodeBuilder.create()
.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BASE_QNAME))
.build();
}
- public static NormalizedNode<?, ?> newCarMapNode() {
+ public static SystemMapNode newCarMapNode() {
return ImmutableNodes.mapNodeBuilder(CAR_QNAME).build();
}
- public static MapEntryNode newCarEntry(final String name, final BigInteger price) {
+ public static MapEntryNode newCarEntry(final String name, final Uint64 price) {
return ImmutableNodes.mapEntryBuilder(CAR_QNAME, CAR_NAME_QNAME, name)
.withChild(ImmutableNodes.leafNode(CAR_NAME_QNAME, name))
.withChild(ImmutableNodes.leafNode(CAR_PRICE_QNAME, price)).build();