• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DataContainerChild类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild的典型用法代码示例。如果您正苦于以下问题:Java DataContainerChild类的具体用法?Java DataContainerChild怎么用?Java DataContainerChild使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataContainerChild类属于org.opendaylight.yangtools.yang.data.api.schema包,在下文中一共展示了DataContainerChild类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: notifyAllListeners

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private void notifyAllListeners() {
    searchForEntities((entityTypeNode, entityNode) -> {
        Optional<DataContainerChild<?, ?>> possibleType = entityTypeNode.getChild(ENTITY_TYPE_NODE_ID);
        if (possibleType.isPresent()) {
            final boolean hasOwner;
            final boolean isOwner;

            Optional<DataContainerChild<?, ?>> possibleOwner = entityNode.getChild(ENTITY_OWNER_NODE_ID);
            if (possibleOwner.isPresent()) {
                isOwner = localMemberName.getName().equals(possibleOwner.get().getValue().toString());
                hasOwner = true;
            } else {
                isOwner = false;
                hasOwner = false;
            }

            DOMEntity entity = new DOMEntity(possibleType.get().getValue().toString(),
                (YangInstanceIdentifier) entityNode.getChild(ENTITY_ID_NODE_ID).get().getValue());

            listenerSupport.notifyEntityOwnershipListeners(entity, isOwner, isOwner, hasOwner);
        }
    });
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:EntityOwnershipShard.java


示例2: searchForEntities

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的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: getMapEntryNodeChild

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的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


示例4: testMergeWithInvalidChildNodeNames

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
@Test
public void testMergeWithInvalidChildNodeNames() throws DataValidationFailedException {
    ContainerNode augContainer = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild(
                    ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build();

    DataContainerChild<?, ?> outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two")));
    ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug")).build();

    YangInstanceIdentifier path = TestModel.TEST_PATH;

    pruningDataTreeModification.merge(path, normalizedNode);

    dataTree.commit(getCandidate());

    ContainerNode prunedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode).build();

    Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(path);
    assertEquals("After pruning present", true, actual.isPresent());
    assertEquals("After pruning", prunedNode, actual.get());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:25,代码来源:PruningDataTreeModificationTest.java


示例5: testWriteWithInvalidChildNodeNames

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
@Test
public void testWriteWithInvalidChildNodeNames() throws DataValidationFailedException {
    ContainerNode augContainer = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild(
                    ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build();

    DataContainerChild<?, ?> outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two")));
    ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug"))
            .withChild(ImmutableNodes.leafNode(NAME_QNAME, "name")).build();

    YangInstanceIdentifier path = TestModel.TEST_PATH;

    pruningDataTreeModification.write(path, normalizedNode);

    dataTree.commit(getCandidate());

    ContainerNode prunedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(ImmutableNodes.leafNode(NAME_QNAME, "name")).build();

    Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(path);
    assertEquals("After pruning present", true, actual.isPresent());
    assertEquals("After pruning", prunedNode, actual.get());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:27,代码来源:PruningDataTreeModificationTest.java


示例6: navigateDataContainerNode

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private void navigateDataContainerNode(int level, final String parentPath,
        final DataContainerNode<?> dataContainerNode) {
    visitor.visitNode(level, parentPath, dataContainerNode);

    String newParentPath = parentPath + "/" + dataContainerNode.getIdentifier().toString();

    final Iterable<DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?>> value = dataContainerNode
            .getValue();
    for (NormalizedNode<?, ?> node : value) {
        if (node instanceof MixinNode && node instanceof NormalizedNodeContainer) {
            navigateNormalizedNodeContainerMixin(level, newParentPath, (NormalizedNodeContainer<?, ?, ?>) node);
        } else {
            navigateNormalizedNode(level, newParentPath, node);
        }
    }

}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:NormalizedNodeNavigator.java


示例7: createProtocolsIps

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<ProtocolIps> createProtocolsIps(final UnkeyedListNode protocolIpsData) {
    final List<ProtocolIps> protocolIps = new ArrayList<>();

    for (final UnkeyedListEntryNode node : protocolIpsData.getValue()) {
        final ProtocolIpsBuilder ipsBuilder = new ProtocolIpsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(AbstractFlowspecNlriParser.OP_NID);
        if (opValue.isPresent()) {
            ipsBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
        if (valueNode.isPresent()) {
            ipsBuilder.setValue((Short) valueNode.get().getValue());
        }
        protocolIps.add(ipsBuilder.build());
    }

    return protocolIps;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:FlowspecIpv4NlriParserHelper.java


示例8: extractFlowspec

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
public final List<Flowspec> extractFlowspec(final DataContainerNode<?> route) {
    requireNonNull(route, "Cannot extract flowspec from null route.");
    final List<Flowspec> fsList = new ArrayList<>();
    final Optional<DataContainerChild<? extends PathArgument, ?>> flowspecs = route.getChild(FLOWSPEC_NID);
    if (flowspecs.isPresent()) {
        for (final UnkeyedListEntryNode flowspec : ((UnkeyedListNode) flowspecs.get()).getValue()) {
            final FlowspecBuilder fsBuilder = new FlowspecBuilder();
            final Optional<DataContainerChild<?, ?>> flowspecType = flowspec.getChild(FLOWSPEC_TYPE_NID);
            if (flowspecType.isPresent()) {
                final ChoiceNode fsType = (ChoiceNode) flowspecType.get();
                processFlowspecType(fsType, fsBuilder);
            }
            fsList.add(fsBuilder.build());
        }
    }
    return fsList;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:18,代码来源:AbstractFlowspecNlriParser.java


示例9: createPorts

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<Ports> createPorts(final UnkeyedListNode portsData) {
    final List<Ports> ports = new ArrayList<>();

    for (final UnkeyedListEntryNode node : portsData.getValue()) {
        final PortsBuilder portsBuilder = new PortsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            portsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            portsBuilder.setValue((Integer) valueNode.get().getValue());
        }
        ports.add(portsBuilder.build());
    }

    return ports;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例10: createDestinationPorts

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<DestinationPorts> createDestinationPorts(final UnkeyedListNode destinationPortsData) {
    final List<DestinationPorts> destinationPorts = new ArrayList<>();

    for (final UnkeyedListEntryNode node : destinationPortsData.getValue()) {
        final DestinationPortsBuilder destPortsBuilder = new DestinationPortsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            destPortsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            destPortsBuilder.setValue((Integer) valueNode.get().getValue());
        }
        destinationPorts.add(destPortsBuilder.build());
    }

    return destinationPorts;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例11: createSourcePorts

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<SourcePorts> createSourcePorts(final UnkeyedListNode sourcePortsData) {
    final List<SourcePorts> sourcePorts = new ArrayList<>();

    for (final UnkeyedListEntryNode node : sourcePortsData.getValue()) {
        final SourcePortsBuilder sourcePortsBuilder = new SourcePortsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            sourcePortsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            sourcePortsBuilder.setValue((Integer) valueNode.get().getValue());
        }
        sourcePorts.add(sourcePortsBuilder.build());
    }

    return sourcePorts;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例12: createTypes

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<Types> createTypes(final UnkeyedListNode typesData) {
    final List<Types> types = new ArrayList<>();

    for (final UnkeyedListEntryNode node : typesData.getValue()) {
        final TypesBuilder typesBuilder = new TypesBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            typesBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            typesBuilder.setValue((Short) valueNode.get().getValue());
        }
        types.add(typesBuilder.build());
    }

    return types;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例13: createCodes

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<Codes> createCodes(final UnkeyedListNode codesData) {
    final List<Codes> codes = new ArrayList<>();

    for (final UnkeyedListEntryNode node : codesData.getValue()) {
        final CodesBuilder codesBuilder = new CodesBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            codesBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            codesBuilder.setValue((Short) valueNode.get().getValue());
        }
        codes.add(codesBuilder.build());
    }

    return codes;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例14: createTcpFlags

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<TcpFlags> createTcpFlags(final UnkeyedListNode tcpFlagsData) {
    final List<TcpFlags> tcpFlags = new ArrayList<>();

    for (final UnkeyedListEntryNode node : tcpFlagsData.getValue()) {
        final TcpFlagsBuilder tcpFlagsBuilder = new TcpFlagsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            tcpFlagsBuilder.setOp(BitmaskOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            tcpFlagsBuilder.setValue((Integer) valueNode.get().getValue());
        }
        tcpFlags.add(tcpFlagsBuilder.build());
    }

    return tcpFlags;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例15: createDscpsLengths

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<Dscps> createDscpsLengths(final UnkeyedListNode dscpLengthsData) {
    final List<Dscps> dscpsLengths = new ArrayList<>();

    for (final UnkeyedListEntryNode node : dscpLengthsData.getValue()) {
        final DscpsBuilder dscpsLengthsBuilder = new DscpsBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
        if (opValue.isPresent()) {
            dscpsLengthsBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
        if (valueNode.isPresent()) {
            dscpsLengthsBuilder.setValue(new Dscp((Short) valueNode.get().getValue()));
        }
        dscpsLengths.add(dscpsLengthsBuilder.build());
    }

    return dscpsLengths;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:AbstractFlowspecNlriParser.java


示例16: processDestination

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
@Override
protected final void processDestination(
    final DOMDataWriteTransaction tx,
    final YangInstanceIdentifier routesPath,
    final ContainerNode destination,
    final ContainerNode attributes,
    final ApplyRoute function
) {
    if (destination != null) {
        final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeQName());
        final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf = destination.getChild(routePathIdNid());
        final String routeKeyValue = this.nlriParser.stringNlri(destination);
        final NodeIdentifierWithPredicates routeKey = PathIdUtil.createNidKey(routeQName(), routeKeyQName(), pathIdQName(), routeKeyValue, maybePathIdLeaf);
        function.apply(tx, base, routeKey, destination, attributes);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:AbstractFlowspecRIBSupport.java


示例17: createNextHeaders

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<NextHeaders> createNextHeaders(final UnkeyedListNode nextHeadersData) {
    final List<NextHeaders> nextHeaders = new ArrayList<>();

    for (final UnkeyedListEntryNode node : nextHeadersData.getValue()) {
        final NextHeadersBuilder nextHeadersBuilder = new NextHeadersBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(AbstractFlowspecNlriParser.OP_NID);
        if (opValue.isPresent()) {
            nextHeadersBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
        if (valueNode.isPresent()) {
            nextHeadersBuilder.setValue((Short) valueNode.get().getValue());
        }
        nextHeaders.add(nextHeadersBuilder.build());
    }

    return nextHeaders;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:FlowspecIpv6NlriParserHelper.java


示例18: createFlowLabels

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static List<FlowLabel> createFlowLabels(final UnkeyedListNode flowLabelsData) {
    final List<FlowLabel> flowLabels = new ArrayList<>();

    for (final UnkeyedListEntryNode node : flowLabelsData.getValue()) {
        final FlowLabelBuilder flowLabelsBuilder = new FlowLabelBuilder();
        final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(AbstractFlowspecNlriParser.OP_NID);
        if (opValue.isPresent()) {
            flowLabelsBuilder.setOp(NumericOneByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
        }
        final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(AbstractFlowspecNlriParser.VALUE_NID);
        if (valueNode.isPresent()) {
            flowLabelsBuilder.setValue((Long) valueNode.get().getValue());
        }
        flowLabels.add(flowLabelsBuilder.build());
    }

    return flowLabels;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:19,代码来源:FlowspecIpv6NlriParserHelper.java


示例19: serializeLocalNodeDescriptor

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static void serializeLocalNodeDescriptor(final CLinkstateDestinationBuilder builder, final ChoiceNode objectType) {
    // link local node descriptors
    final LinkCaseBuilder linkBuilder = new LinkCaseBuilder();

    linkBuilder.setLocalNodeDescriptors(NodeNlriParser.serializeLocalNodeDescriptors((ContainerNode) objectType.getChild(LOCAL_NODE_DESCRIPTORS_NID).get()));
    // link remote node descriptors
    if (objectType.getChild(REMOTE_NODE_DESCRIPTORS_NID).isPresent()) {
        linkBuilder.setRemoteNodeDescriptors(NodeNlriParser.serializeRemoteNodeDescriptors((ContainerNode) objectType.getChild(REMOTE_NODE_DESCRIPTORS_NID).get()));
    }
    // link descriptors
    final Optional<DataContainerChild<? extends PathArgument, ?>> linkDescriptors = objectType.getChild(LINK_DESCRIPTORS_NID);
    if (linkDescriptors.isPresent()) {
        linkBuilder.setLinkDescriptors(LinkNlriParser.serializeLinkDescriptors((ContainerNode) linkDescriptors.get()));
    }
    builder.setObjectType(linkBuilder.build());
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:LinkstateNlriParser.java


示例20: serializeCommonParts

import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; //导入依赖的package包/类
private static void serializeCommonParts(final CLinkstateDestinationBuilder builder, final DataContainerNode<? extends PathArgument> linkstate) {
    // serialize common parts
    final Optional<DataContainerChild<? extends PathArgument, ?>> distinguisher = linkstate.getChild(DISTINGUISHER_NID);
    if (distinguisher.isPresent()) {
        builder.setDistinguisher(new RouteDistinguisher((BigInteger) distinguisher.get().getValue()));
    }
    final Optional<DataContainerChild<? extends PathArgument, ?>> protocolId = linkstate.getChild(PROTOCOL_ID_NID);
    // DOM representation contains values as are in the model, not as are in generated enum
    if (protocolId.isPresent()) {
        builder.setProtocolId(ProtocolId.forValue(domProtocolIdValue((String) protocolId.get().getValue())));
    }
    final Optional<DataContainerChild<? extends PathArgument, ?>> identifier = linkstate.getChild(IDENTIFIER_NID);
    if (identifier.isPresent()) {
        builder.setIdentifier(new Identifier((BigInteger) identifier.get().getValue()));
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:LinkstateNlriParser.java



注:本文中的org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AccountManagerHelper类代码示例发布时间:2022-05-22
下一篇:
Java PublishHelper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap