本文整理汇总了Java中org.opendaylight.yangtools.yang.data.api.schema.MapNode类的典型用法代码示例。如果您正苦于以下问题:Java MapNode类的具体用法?Java MapNode怎么用?Java MapNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapNode类属于org.opendaylight.yangtools.yang.data.api.schema包,在下文中一共展示了MapNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: parseDataElement
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
public NormalizedNode<?, ?> parseDataElement(final Element element, final DataSchemaNode dataSchema,
final SchemaContext schemaContext) throws XMLStreamException, IOException, ParserConfigurationException,
SAXException, URISyntaxException {
final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
final XmlParserStream xmlParser = XmlParserStream.create(writer, schemaContext, dataSchema);
xmlParser.traverse(new DOMSource(element));
final NormalizedNode<?, ?> result = resultHolder.getResult();
if (result instanceof MapNode) {
final MapNode mapNode = (MapNode) result;
final MapEntryNode mapEntryNode = mapNode.getValue().iterator().next();
return mapEntryNode;
}
return result;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:BindingContext.java
示例2: searchForEntities
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private void searchForEntities(final EntityWalker walker) {
Optional<NormalizedNode<?, ?>> possibleEntityTypes = getDataStore().readNode(ENTITY_TYPES_PATH);
if (!possibleEntityTypes.isPresent()) {
return;
}
for (MapEntryNode entityType: ((MapNode) possibleEntityTypes.get()).getValue()) {
Optional<DataContainerChild<?, ?>> possibleEntities = entityType.getChild(ENTITY_NODE_ID);
if (!possibleEntities.isPresent()) {
// shouldn't happen but handle anyway
continue;
}
for (MapEntryNode entity: ((MapNode) possibleEntities.get()).getValue()) {
walker.onEntity(entityType, entity);
}
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:EntityOwnershipShard.java
示例3: verifyCandidates
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static void verifyCandidates(final AbstractDataStore dataStore, final DOMEntity entity,
final String... expCandidates) throws Exception {
AssertionError lastError = null;
Stopwatch sw = Stopwatch.createStarted();
while (sw.elapsed(TimeUnit.MILLISECONDS) <= 10000) {
Optional<NormalizedNode<?, ?>> possible = dataStore.newReadOnlyTransaction()
.read(entityPath(entity.getType(), entity.getIdentifier()).node(Candidate.QNAME))
.get(5, TimeUnit.SECONDS);
try {
assertEquals("Candidates not found for " + entity, true, possible.isPresent());
Collection<String> actual = new ArrayList<>();
for (MapEntryNode candidate: ((MapNode)possible.get()).getValue()) {
actual.add(candidate.getChild(CANDIDATE_NAME_NODE_ID).get().getValue().toString());
}
assertEquals("Candidates for " + entity, Arrays.asList(expCandidates), actual);
return;
} catch (AssertionError e) {
lastError = e;
Uninterruptibles.sleepUninterruptibly(300, TimeUnit.MILLISECONDS);
}
}
throw lastError;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:26,代码来源:DistributedEntityOwnershipIntegrationTest.java
示例4: getMapEntryNodeChild
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
protected MapEntryNode getMapEntryNodeChild(DataContainerNode<? extends PathArgument> parent, QName childMap,
QName child, Object key, boolean expectPresent) {
Optional<DataContainerChild<? extends PathArgument, ?>> childNode =
parent.getChild(new NodeIdentifier(childMap));
assertEquals("Missing " + childMap.toString(), true, childNode.isPresent());
MapNode entityTypeMapNode = (MapNode) childNode.get();
Optional<MapEntryNode> entityTypeEntry = entityTypeMapNode.getChild(new NodeIdentifierWithPredicates(
childMap, child, key));
if (expectPresent && !entityTypeEntry.isPresent()) {
fail("Missing " + childMap.toString() + " entry for " + key + ". Actual: " + entityTypeMapNode.getValue());
} else if (!expectPresent && entityTypeEntry.isPresent()) {
fail("Found unexpected " + childMap.toString() + " entry for " + key);
}
return entityTypeEntry.isPresent() ? entityTypeEntry.get() : null;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:AbstractEntityOwnershipTest.java
示例5: createCrossShardContainer
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static ContainerNode createCrossShardContainer() {
final MapEntryNode outerListEntry1 =
ImmutableNodes.mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.withChild(createInnerMapNode(1))
.build();
final MapEntryNode outerListEntry2 =
ImmutableNodes.mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2)
.withChild(createInnerMapNode(2))
.build();
final MapNode outerList = ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
.withChild(outerListEntry1)
.withChild(outerListEntry2)
.build();
final ContainerNode testContainer = ImmutableContainerNodeBuilder.create()
.withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
.withChild(outerList)
.build();
return testContainer;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:DistributedShardFrontendTest.java
示例6: testInnerContainerNodeWithParentPathPrunedWhenSchemaMissing
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Test
public void testInnerContainerNodeWithParentPathPrunedWhenSchemaMissing() throws IOException {
YangInstanceIdentifier path = YangInstanceIdentifier.builder().node(TestModel.TEST_QNAME)
.node(TestModel.OUTER_LIST_QNAME).nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.build();
NormalizedNodePruner pruner = prunerFullSchema(path);
MapNode innerList = mapNodeBuilder(TestModel.INNER_LIST_QNAME).withChild(mapEntryBuilder(
TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, "one").withChild(
ImmutableNodes.containerNode(TestModel.INVALID_QNAME)).build()).build();
NormalizedNode<?, ?> input = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.withChild(innerList).build();
NormalizedNodeWriter.forStreamWriter(pruner).write(input);
NormalizedNode<?, ?> expected = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.withChild(mapNodeBuilder(TestModel.INNER_LIST_QNAME).withChild(mapEntryBuilder(
TestModel.INNER_LIST_QNAME, TestModel.NAME_QNAME, "one").build()).build()).build();
NormalizedNode<?, ?> actual = pruner.normalizedNode();
assertEquals("normalizedNode", expected, actual);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:NormalizedNodePrunerTest.java
示例7: testInnerListNodeWithParentPathPrunedWhenSchemaMissing
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Test
public void testInnerListNodeWithParentPathPrunedWhenSchemaMissing() throws IOException {
YangInstanceIdentifier path = YangInstanceIdentifier.builder().node(TestModel.TEST_QNAME)
.node(TestModel.OUTER_LIST_QNAME).nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.build();
NormalizedNodePruner pruner = prunerFullSchema(path);
MapNode innerList = mapNodeBuilder(TestModel.INVALID_QNAME).withChild(mapEntryBuilder(
TestModel.INVALID_QNAME, TestModel.NAME_QNAME, "one").withChild(
ImmutableNodes.containerNode(TestModel.INNER_CONTAINER_QNAME)).build()).build();
NormalizedNode<?, ?> input = mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
.withChild(innerList).build();
NormalizedNodeWriter.forStreamWriter(pruner).write(input);
NormalizedNode<?, ?> expected = mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1);
NormalizedNode<?, ?> actual = pruner.normalizedNode();
assertEquals("normalizedNode", expected, actual);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:NormalizedNodePrunerTest.java
示例8: loadConfiguration
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Override
public synchronized void loadConfiguration(final NormalizedNode<?, ?> dto) {
final ContainerNode protocolsContainer = (ContainerNode) dto;
final MapNode protocolList = (MapNode) protocolsContainer.getChild(protocolYIId.getLastPathArgument()).get();
final Collection<MapEntryNode> protocolsCollection = protocolList.getValue();
final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();
for (final MapEntryNode protocolEntry : protocolsCollection) {
final Map.Entry<InstanceIdentifier<?>, DataObject> bi = this.bindingSerializer
.fromNormalizedNode(this.protocolYIId, protocolEntry);
if (bi != null) {
final Protocol protocol = (Protocol) bi.getValue();
processProtocol(protocol, wtx);
}
}
try {
wtx.submit().get();
} catch (final ExecutionException | InterruptedException e) {
LOG.warn("Failed to create Protocol", e);
}
}
开发者ID:opendaylight,项目名称:bgpcep,代码行数:21,代码来源:ProtocolsConfigFileProcessor.java
示例9: loadConfiguration
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Override
public synchronized void loadConfiguration(final NormalizedNode<?, ?> dto) {
final ContainerNode networkTopologyContainer = (ContainerNode) dto;
final MapNode topologyList = (MapNode) networkTopologyContainer.getChild(
this.topologyYii.getLastPathArgument()).get();
final Collection<MapEntryNode> networkTopology = topologyList.getValue();
if (networkTopology.isEmpty()) {
return;
}
final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();
for (final MapEntryNode topologyEntry : networkTopology) {
final Map.Entry<InstanceIdentifier<?>, DataObject> bi =
this.bindingSerializer.fromNormalizedNode(this.topologyYii, topologyEntry);
if (bi != null) {
processTopology((Topology) bi.getValue(), wtx);
}
}
try {
wtx.submit().get();
} catch (final ExecutionException | InterruptedException e) {
LOG.warn("Failed to create Network Topologies", e);
}
}
开发者ID:opendaylight,项目名称:bgpcep,代码行数:25,代码来源:NetworkTopologyConfigFileProcessor.java
示例10: loadConfiguration
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Override
public synchronized void loadConfiguration(final NormalizedNode<?, ?> dto) {
final ContainerNode bmpMonitorsConfigsContainer = (ContainerNode) dto;
final MapNode monitorsList = (MapNode) bmpMonitorsConfigsContainer.getChild(
this.bmpMonitorsYii.getLastPathArgument()).orElse(null);
if (monitorsList == null) {
return;
}
final Collection<MapEntryNode> bmpMonitorConfig = monitorsList.getValue();
final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();
bmpMonitorConfig.stream().map(topology -> this.bindingSerializer
.fromNormalizedNode(this.bmpMonitorsYii, topology))
.filter(Objects::nonNull)
.forEach(bi -> processBmpMonitorConfig((BmpMonitorConfig) bi.getValue(), wtx));
try {
wtx.submit().get();
} catch (final ExecutionException | InterruptedException e) {
LOG.warn("Failed to create Bmp config", e);
}
}
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:BmpMonitorConfigFileProcessor.java
示例11: createCon3Node
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static ContainerNode createCon3Node() {
final CollectionNodeBuilder<MapEntryNode, MapNode> mapBuilder = Builders
.mapBuilder();
mapBuilder.withNodeIdentifier(new NodeIdentifier(list3InChoice));
mapBuilder.addChild(createList3Entry("k1", "val1", "valA", "valX"));
mapBuilder.addChild(createList3Entry("k2", "val2", "valB", "valY"));
final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> choiceBuilder = Builders
.choiceBuilder();
choiceBuilder.withNodeIdentifier(new NodeIdentifier(choiceInCon3));
choiceBuilder.addChild(mapBuilder.build());
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> containerBuilder = Builders
.containerBuilder();
containerBuilder.withNodeIdentifier(new NodeIdentifier(con3));
containerBuilder.addChild(choiceBuilder.build());
return containerBuilder.build();
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:24,代码来源:DataTreeCandidateValidatorTest.java
示例12: createOdlContainer
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static ContainerNode createOdlContainer(
final ContainerSchemaNode container) {
final ListSchemaNode projListSchemaNode = (ListSchemaNode) container
.getDataChildByName(project);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> odlProjectContainerBldr = Builders
.containerBuilder(container);
final MapNode projectMap = createProjectList(projListSchemaNode);
odlProjectContainerBldr.addChild(projectMap);
final ContainerNode odlProjectContainer = odlProjectContainerBldr
.build();
return odlProjectContainer;
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:DataTreeCandidateValidatorTest.java
示例13: createProjectList
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static MapNode createProjectList(
final ListSchemaNode projListSchemaNode) {
final CollectionNodeBuilder<MapEntryNode, MapNode> projectMapBldr = Builders
.mapBuilder(projListSchemaNode);
final MapEntryNode projMapEntry1 = createProjectListEntry("Yangtools",
"Yangtools description ...", "Leader of Yangtools",
"Owner of Yangtools", projListSchemaNode);
final MapEntryNode projMapEntry2 = createProjectListEntry("MD-SAL",
"MD-SAL description ...", "Leader of MD-SAL",
"Owner of MD-SAL", projListSchemaNode);
final MapEntryNode projMapEntry3 = createProjectListEntry("Controller",
"Controller description ...", "Leader of Controller",
"Owner of Controller", projListSchemaNode);
projectMapBldr.addChild(projMapEntry1);
projectMapBldr.addChild(projMapEntry2);
projectMapBldr.addChild(projMapEntry3);
final MapNode projectMap = projectMapBldr.build();
return projectMap;
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest.java
示例14: createBasicContributorList
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static MapNode createBasicContributorList(
final ListSchemaNode contributorListSchemaNode) {
final CollectionNodeBuilder<MapEntryNode, MapNode> contributorMapBldr = Builders
.mapBuilder(contributorListSchemaNode);
final MapEntryNode contributorMapEntry1 = createContributorListEntry(
"Leader of Yangtools", "Yangtools Leader name", "Yangtools",
"Yangtools description ...", contributorListSchemaNode);
final MapEntryNode contributorMapEntry2 = createContributorListEntry(
"Leader of MD-SAL", "MD-SAL Leader name", "MD-SAL",
"MD-SAL description ...", contributorListSchemaNode);
final MapEntryNode contributorMapEntry3 = createContributorListEntry(
"Leader of Controller", "Controller Leader name", "Controller",
"Controller description ...", contributorListSchemaNode);
contributorMapBldr.addChild(contributorMapEntry1);
contributorMapBldr.addChild(contributorMapEntry2);
contributorMapBldr.addChild(contributorMapEntry3);
final MapNode contributorMap = contributorMapBldr.build();
return contributorMap;
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest.java
示例15: createDeviceList
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static MapNode createDeviceList(final ListSchemaNode deviceListSchemaNode) {
final CollectionNodeBuilder<MapEntryNode, MapNode> devicesMapBldr = Builders.mapBuilder(deviceListSchemaNode);
devicesMapBldr.addChild(createDeviceListEntry("dev_type_1", "typedesc1", 123456, "192.168.0.1",
deviceListSchemaNode));
devicesMapBldr.addChild(createDeviceListEntry("dev_type_2", "typedesc2", 123457, "192.168.0.1",
deviceListSchemaNode));
devicesMapBldr.addChild(createDeviceListEntry("dev_type_2", "typedesc3", 123457, "192.168.0.1",
deviceListSchemaNode));
devicesMapBldr.addChild(createDeviceListEntry("dev_type_1", "typedesc2", 123458, "192.168.0.1",
deviceListSchemaNode));
devicesMapBldr
.addChild(createDeviceListEntry("unknown", "unknown", 123457, "192.168.0.1", deviceListSchemaNode));
return devicesMapBldr.build();
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:18,代码来源:DataTreeCandidateValidatorTest2.java
示例16: writeInvalidContainerTest
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Test
public void writeInvalidContainerTest() throws DataValidationFailedException {
final DataTree inMemoryDataTree = emptyDataTree(schemaContext);
final MapNode myList = createMap(true);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> root = Builders.containerBuilder()
.withNodeIdentifier(new NodeIdentifier(ROOT)).withChild(myList);
final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
modificationTree.write(YangInstanceIdentifier.of(ROOT), root.build());
try {
modificationTree.ready();
inMemoryDataTree.validate(modificationTree);
final DataTreeCandidate prepare = inMemoryDataTree.prepare(modificationTree);
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
assertEquals(
"Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
+ "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:24,代码来源:Bug5968Test.java
示例17: mergeInvalidContainerTest
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Test
public void mergeInvalidContainerTest() throws DataValidationFailedException {
final DataTree inMemoryDataTree = emptyDataTree(schemaContext);
final MapNode myList = createMap(true);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> root = Builders.containerBuilder()
.withNodeIdentifier(new NodeIdentifier(ROOT)).withChild(myList);
final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
modificationTree.merge(YangInstanceIdentifier.of(ROOT), root.build());
try {
modificationTree.ready();
inMemoryDataTree.validate(modificationTree);
final DataTreeCandidate prepare = inMemoryDataTree.prepare(modificationTree);
inMemoryDataTree.commit(prepare);
fail("Should fail due to missing mandatory leaf.");
} catch (final IllegalArgumentException e) {
assertEquals(
"Node (foo?revision=2016-07-28)my-list[{(foo?revision=2016-07-28)list-id=1}] is missing mandatory "
+ "descendant /(foo?revision=2016-07-28)mandatory-leaf", e.getMessage());
}
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:24,代码来源:Bug5968MergeTest.java
示例18: testListLastChildOverride
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
@Test
public void testListLastChildOverride() {
final MapEntryNode outerListEntry = Builders
.mapEntryBuilder()
.withNodeIdentifier(outerListWithKey)
.withChild(
Builders.leafBuilder().withNodeIdentifier(new NodeIdentifier(ID))
.withValue(1).build()).build();
final MapNode lastChild = Builders.mapBuilder().withNodeIdentifier(this.outerList).withChild(outerListEntry)
.build();
final ContainerNode expectedStructure = Builders.containerBuilder().withNodeIdentifier(rootContainer)
.withChild(lastChild).build();
NormalizedNode<?, ?> filter = ImmutableNodes.fromInstanceId(ctx,
YangInstanceIdentifier.create(rootContainer, outerList, outerListWithKey), outerListEntry);
assertEquals(expectedStructure, filter);
filter = ImmutableNodes.fromInstanceId(ctx,
YangInstanceIdentifier.create(rootContainer, outerList, outerListWithKey));
assertEquals(expectedStructure, filter);
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:21,代码来源:InstanceIdToNodesTest.java
示例19: buildMyContainerNodeForIIdTest
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static ContainerNode buildMyContainerNodeForIIdTest(final LeafNode<?> referencedLeafNode) {
final Map<QName, Object> keyValues = ImmutableMap.of(keyLeafA, "key-value-a", keyLeafB, "key-value-b");
final YangInstanceIdentifier iidPath = YangInstanceIdentifier.of(myContainer).node(myList)
.node(new NodeIdentifierWithPredicates(myList, keyValues)).node(referencedLeaf);
final LeafNode<?> iidLeafNode = Builders.leafBuilder().withNodeIdentifier(new NodeIdentifier(iidLeaf))
.withValue(iidPath).build();
final MapNode myListNode = Builders.mapBuilder().withNodeIdentifier(new NodeIdentifier(myList))
.withChild(Builders.mapEntryBuilder().withNodeIdentifier(
new NodeIdentifierWithPredicates(myList, keyValues))
.withChild(iidLeafNode)
.withChild(referencedLeafNode).build())
.build();
final ContainerNode myContainerNode = Builders.containerBuilder().withNodeIdentifier(
new NodeIdentifier(myContainer)).withChild(myListNode).build();
return myContainerNode;
}
开发者ID:opendaylight,项目名称:yangtools,代码行数:20,代码来源:DerefXPathFunctionTest.java
示例20: buildInnerList
import org.opendaylight.yangtools.yang.data.api.schema.MapNode; //导入依赖的package包/类
private static MapNode buildInnerList(final int index, final int elements ) {
CollectionNodeBuilder<MapEntryNode, MapNode> innerList = ImmutableNodes.mapNodeBuilder(InnerList.QNAME);
final String itemStr = "Item-" + String.valueOf(index) + "-";
for (int i = 0; i < elements; i++) {
innerList.addChild(ImmutableNodes.mapEntryBuilder()
.withNodeIdentifier(new NodeIdentifierWithPredicates(InnerList.QNAME, IL_NAME, i))
.withChild(ImmutableNodes.leafNode(IL_NAME, i))
.withChild(ImmutableNodes.leafNode(IL_VALUE, itemStr + String.valueOf(i)))
.build());
}
return innerList.build();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:DomListBuilder.java
注:本文中的org.opendaylight.yangtools.yang.data.api.schema.MapNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论