static ContainerNode entityOwnersWithEntityTypeEntry(MapEntryNode entityTypeNode) { return ImmutableContainerNodeBuilder.create().withNodeIdentifier( ENTITY_OWNERS_NODE_ID).addChild(ImmutableNodes.mapNodeBuilder(EntityType.QNAME). addChild(entityTypeNode).build()).build(); }
/** * Construct immutable leaf node. * * @param name Identifier of leaf node * @param value Value of leaf node * @param <T> Type of leaf node value * @return Leaf node with supplied identifier and value */ public static <T> LeafNode<T> leafNode(final NodeIdentifier name, final T value) { return ImmutableLeafNodeBuilder.<T>create() .withNodeIdentifier(name) .withValue(value) .build(); }
public static DataContainerChild<?, ?> getSourceNode(final QName datastore) { return Builders.containerBuilder().withNodeIdentifier(toId(NETCONF_SOURCE_QNAME)) .withChild( Builders.choiceBuilder().withNodeIdentifier(toId(ConfigSource.QNAME)).withChild( Builders.leafBuilder().withNodeIdentifier(toId(datastore)).build()).build() ).build(); }
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(); } }
private static void ensureParentExists(final DOMDataWriteTransaction wTx, final YangInstanceIdentifier path) { final ContainerNode parentNode = Builders.containerBuilder().withNodeIdentifier( new NodeIdentifier(BmpMonitor.QNAME)).addChild(ImmutableNodes.mapNodeBuilder(Monitor.QNAME).build()).build(); wTx.merge(LogicalDatastoreType.OPERATIONAL, path, parentNode); }
/** * Create an immutable map node. * * @param name QName which will be used as node identifier * @return An unordered Map node */ public static MapNode mapNode(final QName name) { return mapNodeBuilder(name).build(); }
private static MapNode initInnerListItems(final int count) { final CollectionNodeBuilder<MapEntryNode, MapNode> mapEntryBuilder = ImmutableNodes .mapNodeBuilder(BenchmarkModel.INNER_LIST); for (int i = 0; i < count; ++i) { mapEntryBuilder .withChild(ImmutableNodes.mapEntry(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i)); } return mapEntryBuilder.build(); }
static MapNode candidateEntry(String candidateName) { return ImmutableOrderedMapNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(Candidate.QNAME)). addChild(candidateMapEntry(candidateName)).build(); }
public static MapEntryNode mapEntry(final QName nodeName,final QName keyName,final Object keyValue) { return mapEntryBuilder(nodeName, keyName, keyValue).build(); }
public static ContainerNode createTestContainer() { return createBaseTestContainerBuilder().build(); }
@SuppressWarnings("unchecked") protected void writeChild(final NormalizedNode<?, ?> child) { getCurrent().addChild(child); }
public static DataContainerChild<?, ?> getTargetNode(final QName datastore) { return Builders.containerBuilder().withNodeIdentifier(toId(NETCONF_TARGET_QNAME)) .withChild( Builders.choiceBuilder().withNodeIdentifier(toId(ConfigTarget.QNAME)).withChild( Builders.leafBuilder().withNodeIdentifier(toId(datastore)).build()).build() ).build(); }
/** * Create immutable ordered map node. * * @param name QName which will be used as node identifier * @return An ordered Map node */ public static OrderedMapNode orderedMapNode(final QName name) { return orderedMapNodeBuilder(name).build(); }
@SuppressWarnings("unchecked") protected void writeChild(final NormalizedNode<?, ?> child) { getCurrent().addChild(child); }
/** * Create an immutable map node. * * @param name QName which will be used as node identifier * @return An unordered Map node */ public static MapNode mapNode(final QName name) { return mapNodeBuilder(name).build(); }
/** * Create immutable ordered map node. * * @param name QName which will be used as node identifier * @return An ordered Map node */ public static OrderedMapNode orderedMapNode(final QName name) { return orderedMapNodeBuilder(name).build(); }