当前位置: 首页>>代码示例>>Java>>正文


Java ImmutableUnkeyedListEntryNodeBuilder.create方法代码示例

本文整理汇总了Java中org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder.create方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableUnkeyedListEntryNodeBuilder.create方法的具体用法?Java ImmutableUnkeyedListEntryNodeBuilder.create怎么用?Java ImmutableUnkeyedListEntryNodeBuilder.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder的用法示例。


在下文中一共展示了ImmutableUnkeyedListEntryNodeBuilder.create方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testExtractEvpnDestination

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Test
public void testExtractEvpnDestination() throws BGPParsingException {
    final DataContainerNodeAttrBuilder<NodeIdentifier, UnkeyedListEntryNode> evpnBI =
            ImmutableUnkeyedListEntryNodeBuilder.create();
    evpnBI.withNodeIdentifier(EVPN_NID);
    evpnBI.withChild(createMACIpAdvChoice());
    evpnBI.withChild(createValueBuilder(RD_MODEL, RD_NID).build());
    final EvpnDestination destResult = EvpnNlriParser.extractEvpnDestination(evpnBI.build());
    final EvpnDestination expected = new EvpnDestinationBuilder()
            .setRouteDistinguisher(RD)
            .setEvpnChoice(MACIpAdvRParserTest.createdExpectedResult()).build();
    assertEquals(expected, destResult);
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:14,代码来源:EvpnNlriParserTest.java

示例2: testExtractRouteKey

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Test
public void testExtractRouteKey() throws BGPParsingException {
    final DataContainerNodeAttrBuilder<NodeIdentifier, UnkeyedListEntryNode> evpnBI =
            ImmutableUnkeyedListEntryNodeBuilder.create();
    evpnBI.withNodeIdentifier(EVPN_CHOICE_NID);
    evpnBI.withChild(createValueBuilder(RD_MODEL, RD_NID).build());
    evpnBI.withChild(createMACIpAdvChoice());
    final EvpnDestination destResult = EvpnNlriParser.extractRouteKeyDestination(evpnBI.build());
    final EvpnDestination expected = new EvpnDestinationBuilder().setRouteDistinguisher(RD)
            .setEvpnChoice(MACIpAdvRParserTest.createdExpectedRouteKey()).build();
    assertEquals(expected, destResult);
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:13,代码来源:EvpnNlriParserTest.java

示例3: applyWrite

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Override
protected TreeNode applyWrite(final ModifiedNode modification,
        final Optional<TreeNode> currentMeta, final Version version) {
    final NormalizedNode<?, ?> newValue = modification.getWrittenValue();
    final TreeNode newValueMeta = TreeNodeFactory.createTreeNode(newValue, version);

    if (modification.getChildren().isEmpty()) {
        return newValueMeta;
    }

    /*
     * This is where things get interesting. The user has performed a write and
     * then she applied some more modifications to it. So we need to make sense
     * of that an apply the operations on top of the written value. We could have
     * done it during the write, but this operation is potentially expensive, so
     * we have left it out of the fast path.
     *
     * As it turns out, once we materialize the written data, we can share the
     * code path with the subtree change. So let's create an unsealed TreeNode
     * and run the common parts on it -- which end with the node being sealed.
     */
    final MutableTreeNode mutable = newValueMeta.mutable();
    mutable.setSubtreeVersion(version);

    @SuppressWarnings("rawtypes")
    final NormalizedNodeContainerBuilder dataBuilder = ImmutableUnkeyedListEntryNodeBuilder
        .create((UnkeyedListEntryNode) newValue);

    return mutateChildren(mutable, dataBuilder, version, modification.getChildren());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:31,代码来源:UnkeyedListModificationStrategy.java

示例4: startUnkeyedListItem

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Override
public void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) {
    Preconditions.checkArgument(getCurrent() instanceof NormalizedNodeResultBuilder
            || getCurrent() instanceof ImmutableUnkeyedListNodeBuilder);
    final DataContainerNodeAttrBuilder<NodeIdentifier, UnkeyedListEntryNode> builder =
            UNKNOWN_SIZE == childSizeHint ? ImmutableUnkeyedListEntryNodeBuilder.create()
                    : ImmutableUnkeyedListEntryNodeBuilder.create(childSizeHint);
    enter(builder.withNodeIdentifier(name));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:10,代码来源:ImmutableNormalizedNodeStreamWriter.java

示例5: testNodeNlri

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Test
public void testNodeNlri() throws BGPParsingException {
    setUp(this.nodeNlri);

    // test BA form
    assertNull(this.dest.getDistinguisher());
    assertEquals(ProtocolId.IsisLevel2, this.dest.getProtocolId());
    assertEquals(BigInteger.ONE, this.dest.getIdentifier().getValue());
    final NodeCase nCase = ((NodeCase) this.dest.getObjectType());

    final NodeDescriptors nodeD = nCase.getNodeDescriptors();
    assertEquals(new AsNumber(72L), nodeD.getAsNumber());
    assertEquals(new DomainIdentifier(0x28282828L), nodeD.getDomainId());
    assertEquals(new IsisPseudonodeCaseBuilder().setIsisPseudonode(
        new IsisPseudonodeBuilder().setPsn((short) 5).setIsIsRouterIdentifier(
           new IsIsRouterIdentifierBuilder().setIsoSystemId(new IsoSystemIdentifier(new byte[] { 0, 0, 0, 0, 0, (byte) 0x39 })).build()).build()).build(), nodeD.getCRouterIdentifier());

    final ByteBuf buffer = Unpooled.buffer();
    this.registry.serializeNlriType(this.dest, buffer);
    assertArrayEquals(this.nodeNlri, ByteArray.readAllBytes(buffer));

    // test BI form
    final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> linkstateBI = ImmutableUnkeyedListEntryNodeBuilder
            .create();
    linkstateBI.withNodeIdentifier(C_LINKSTATE_NID);

    final ImmutableLeafNodeBuilder<String> protocolId = new ImmutableLeafNodeBuilder<>();
    protocolId.withNodeIdentifier(LinkstateNlriParser.PROTOCOL_ID_NID);
    protocolId.withValue("isis-level2");
    linkstateBI.addChild(protocolId.build());

    final ImmutableLeafNodeBuilder<BigInteger> identifier = new ImmutableLeafNodeBuilder<>();
    identifier.withNodeIdentifier(LinkstateNlriParser.IDENTIFIER_NID);
    identifier.withValue(BigInteger.ONE);
    linkstateBI.addChild(identifier.build());

    final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> objectType = Builders.choiceBuilder();
    objectType.withNodeIdentifier(LinkstateNlriParser.OBJECT_TYPE_NID);

    final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> nodeDescriptors = Builders.containerBuilder();
    nodeDescriptors.withNodeIdentifier(LinkstateNlriParser.NODE_DESCRIPTORS_NID);

    final ImmutableLeafNodeBuilder<Long> asNumber = new ImmutableLeafNodeBuilder<>();
    asNumber.withNodeIdentifier(NodeNlriParser.AS_NUMBER_NID);
    asNumber.withValue(72L);
    nodeDescriptors.addChild(asNumber.build());

    final ImmutableLeafNodeBuilder<Long> areaID = new ImmutableLeafNodeBuilder<>();
    areaID.withNodeIdentifier(NodeNlriParser.AREA_NID);
    areaID.withValue(2697513L); nodeDescriptors.addChild(areaID.build());

    final ImmutableLeafNodeBuilder<Long> domainID = new ImmutableLeafNodeBuilder<>();
    domainID.withNodeIdentifier(NodeNlriParser.DOMAIN_NID);
    domainID.withValue(0x28282828L);
    nodeDescriptors.addChild(domainID.build());

    final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> crouterId = Builders.choiceBuilder();
    crouterId.withNodeIdentifier(C_ROUTER_ID_NID);

    final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> isisNode = Builders.containerBuilder();
    isisNode.withNodeIdentifier(NodeNlriParser.ISIS_PSEUDONODE_NID);

    final ImmutableLeafNodeBuilder<byte[]> isoSystemID = new ImmutableLeafNodeBuilder<>();
    isoSystemID.withNodeIdentifier(NodeNlriParser.ISO_SYSTEM_NID);
    isoSystemID.withValue(new byte[]{0, 0, 0, 0, 0, (byte) 0x39});

    final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> isisPseudoRouter = Builders.containerBuilder();
    isisPseudoRouter.withNodeIdentifier(NodeNlriParser.ISIS_ROUTER_NID);
    isisPseudoRouter.addChild(isoSystemID.build());

    isisNode.addChild(isisPseudoRouter.build());
    isisNode.addChild(Builders.leafBuilder().withNodeIdentifier(NodeNlriParser.PSN_NID).withValue((short) 5).build());
    crouterId.addChild(isisNode.build());

    nodeDescriptors.addChild(crouterId.build());
    objectType.addChild(nodeDescriptors.build());
    linkstateBI.addChild(objectType.build());

    assertEquals(this.dest, LinkstateNlriParser.extractLinkstateDestination(linkstateBI.build()));
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:81,代码来源:LinkstateNlriParserTest.java

示例6: testTELspNlri

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Test
public void testTELspNlri() throws BGPParsingException {
    setUp(this.teLspNlri);
    // test BA form
    assertNull(this.dest.getDistinguisher());
    assertEquals(ProtocolId.RsvpTe, this.dest.getProtocolId());
    assertEquals(BigInteger.ONE, this.dest.getIdentifier().getValue());
    final TeLspCase teCase = (TeLspCase) this.dest.getObjectType();

    assertEquals(new LspId(1L), teCase.getLspId());
    assertEquals(new TunnelId(1), teCase.getTunnelId());
    assertEquals(new Ipv4Address("1.2.3.4"), ((Ipv4Case) teCase.getAddressFamily()).getIpv4TunnelSenderAddress());
    assertEquals(new Ipv4Address("4.3.2.1"), ((Ipv4Case) teCase.getAddressFamily()).getIpv4TunnelEndpointAddress());

    // test BI form
    final DataContainerNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, UnkeyedListEntryNode> linkstateBI = ImmutableUnkeyedListEntryNodeBuilder.create();
    linkstateBI.withNodeIdentifier(C_LINKSTATE_NID);

    final ImmutableLeafNodeBuilder<String> protocolId = new ImmutableLeafNodeBuilder<>();
    protocolId.withNodeIdentifier(LinkstateNlriParser.PROTOCOL_ID_NID);
    protocolId.withValue("rsvp-te");
    linkstateBI.addChild(protocolId.build());

    final ImmutableLeafNodeBuilder<BigInteger> identifier = new ImmutableLeafNodeBuilder<>();
    identifier.withNodeIdentifier(LinkstateNlriParser.IDENTIFIER_NID);
    identifier.withValue(BigInteger.ONE);
    linkstateBI.addChild(identifier.build());

    final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> objectType = Builders.choiceBuilder();
    objectType.withNodeIdentifier(LinkstateNlriParser.OBJECT_TYPE_NID);

    final ImmutableLeafNodeBuilder<Long> lspId = new ImmutableLeafNodeBuilder<>();
    lspId.withNodeIdentifier(AbstractTeLspNlriCodec.LSP_ID);
    lspId.withValue(1L);

    final ImmutableLeafNodeBuilder<Integer> tunnelId = new ImmutableLeafNodeBuilder<>();
    tunnelId.withNodeIdentifier(AbstractTeLspNlriCodec.TUNNEL_ID);
    tunnelId.withValue(1);

    final DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> addressFamily = Builders.choiceBuilder();
    addressFamily.withNodeIdentifier(AbstractTeLspNlriCodec.ADDRESS_FAMILY);

    final ImmutableLeafNodeBuilder<String> ipv4TunnelSenderAddress = new ImmutableLeafNodeBuilder<>();
    ipv4TunnelSenderAddress.withNodeIdentifier(AbstractTeLspNlriCodec.IPV4_TUNNEL_SENDER_ADDRESS);
    ipv4TunnelSenderAddress.withValue("1.2.3.4");

    final ImmutableLeafNodeBuilder<String> ipv4TunnelEndPointAddress = new ImmutableLeafNodeBuilder<>();
    ipv4TunnelEndPointAddress.withNodeIdentifier(AbstractTeLspNlriCodec.IPV4_TUNNEL_ENDPOINT_ADDRESS);
    ipv4TunnelEndPointAddress.withValue("4.3.2.1");

    addressFamily.addChild(ipv4TunnelSenderAddress.build());
    addressFamily.addChild(ipv4TunnelEndPointAddress.build());

    objectType.addChild(lspId.build());
    objectType.addChild(tunnelId.build());
    objectType.addChild(addressFamily.build());

    linkstateBI.addChild(objectType.build());
    assertEquals(this.dest, LinkstateNlriParser.extractLinkstateDestination(linkstateBI.build()));
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:61,代码来源:LinkstateNlriParserTest.java

示例7: unkeyedListEntryBuilder

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
public static DataContainerNodeAttrBuilder<NodeIdentifier, UnkeyedListEntryNode> unkeyedListEntryBuilder() {
    return ImmutableUnkeyedListEntryNodeBuilder.create();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:4,代码来源:Builders.java

示例8: createBuilder

import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableUnkeyedListEntryNodeBuilder; //导入方法依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
protected DataContainerNodeBuilder createBuilder(final NormalizedNode<?, ?> original) {
    checkArgument(original instanceof UnkeyedListEntryNode);
    return ImmutableUnkeyedListEntryNodeBuilder.create((UnkeyedListEntryNode) original);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:7,代码来源:UnkeyedListItemModificationStrategy.java


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