Tabnine Logo
UnkeyedListNode.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode

Best Java code snippets using org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode.getValue (Showing top 20 results out of 315)

origin: org.opendaylight.yangtools/yang-data-operations

private List<UnkeyedListEntryNode> unkeyedListEntries(UnkeyedListNode unkeyedListNode) {
  List<UnkeyedListEntryNode> unkeyedListEntries = Lists.newArrayList();
  for (UnkeyedListEntryNode unkeyedListEntryNode : unkeyedListNode.getValue()) {
    unkeyedListEntries.add(unkeyedListEntryNode);
  }
  return unkeyedListEntries;
}
origin: org.opendaylight.mdsal/mdsal-binding2-dom-codec

  private List<D> fromUnkeyedList(final UnkeyedListNode nodes) {
    // FIXME: Could be this lazy transformed list?
    final List<D> ret = new ArrayList<>(nodes.getValue().size());
    for (final UnkeyedListEntryNode node : nodes.getValue()) {
      ret.add(fromUnkeyedListEntry(node));
    }
    return ret;
  }
}
origin: org.opendaylight.mdsal/mdsal-binding-dom-codec

  private List<D> fromUnkeyedList(final UnkeyedListNode nodes) {
    // FIXME: Could be this lazy transformed list?
    List<D> ret = new ArrayList<>(nodes.getValue().size());
    for (UnkeyedListEntryNode node : nodes.getValue()) {
      ret.add(fromUnkeyedListEntry(node));
    }
    return ret;
  }
}
origin: org.opendaylight.bgpcep/bgp-flowspec

public final List<Flowspec> extractFlowspec(final DataContainerNode<?> route) {
  Preconditions.checkNotNull(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;
}
origin: org.opendaylight.bgpcep/bgp-linkstate

private void processRoute(final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes, final YangInstanceIdentifier routesPath,
  final ContainerNode attributes, final ApplyRoute function, final DOMDataWriteTransaction tx) {
  if (maybeRoutes.isPresent()) {
    final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
    if (routes instanceof UnkeyedListNode) {
      final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(this.route);
      for (final UnkeyedListEntryNode e : ((UnkeyedListNode) routes).getValue()) {
        final NodeIdentifierWithPredicates routeKey = createRouteKey(e);
        function.apply(tx, base, routeKey, e, attributes);
      }
    } else {
      LOG.warn("Routes {} are not a map", routes);
    }
  }
}
origin: org.opendaylight.bgpcep/bgp-flowspec

private static final 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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

private static final 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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

private static List<PacketLengths> createPacketLengths(final UnkeyedListNode packetLengthsData) {
  final List<PacketLengths> packetLengths = new ArrayList<>();
  for (final UnkeyedListEntryNode node : packetLengthsData.getValue()) {
    final PacketLengthsBuilder packetLengthsBuilder = new PacketLengthsBuilder();
    final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
    if (opValue.isPresent()) {
      packetLengthsBuilder.setOp(NumericTwoByteOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
    }
    final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
    if (valueNode.isPresent()) {
      packetLengthsBuilder.setValue((Integer) valueNode.get().getValue());
    }
    packetLengths.add(packetLengthsBuilder.build());
  }
  return packetLengths;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

private static final 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;
}
origin: org.opendaylight.bgpcep/bgp-flowspec

private static List<Fragments> createFragments(final UnkeyedListNode fragmentsData) {
  final List<Fragments> fragments = new ArrayList<>();
  for (final UnkeyedListEntryNode node : fragmentsData.getValue()) {
    final FragmentsBuilder fragmentsBuilder = new FragmentsBuilder();
    final Optional<DataContainerChild<? extends PathArgument, ?>> opValue = node.getChild(OP_NID);
    if (opValue.isPresent()) {
      fragmentsBuilder.setOp(BitmaskOperandParser.INSTANCE.create((Set<String>) opValue.get().getValue()));
    }
    final Optional<DataContainerChild<? extends PathArgument, ?>> valueNode = node.getChild(VALUE_NID);
    if (valueNode.isPresent()) {
      fragmentsBuilder.setValue(createFragment((Set<String>) valueNode.get().getValue()));
    }
    fragments.add(fragmentsBuilder.build());
  }
  return fragments;
}
origin: org.opendaylight.bgpcep/bgp-evpn

@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath,
  final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
  if (destination != null) {
    final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination.getChild(NLRI_ROUTES_LIST);
    if (maybeRoutes.isPresent()) {
      final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
      if (routes instanceof UnkeyedListNode) {
        final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeNid());
        for (final UnkeyedListEntryNode e : ((UnkeyedListNode) routes).getValue()) {
          final NodeIdentifierWithPredicates routeKey = createRouteKey(e);
          function.apply(tx, base, routeKey, e, attributes);
        }
      } else {
        LOG.warn("Routes {} are not a map", routes);
      }
    }
  }
}
origin: org.opendaylight.bgpcep/bgp-inet

@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath,
  final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
  if (destination != null) {
    final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination.getChild(this.nlriRoutesList);
    if (maybeRoutes.isPresent()) {
      final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
      if (routes instanceof UnkeyedListNode) {
        // Instance identifier to table/(choice routes)/(map of route)
        // FIXME: cache on per-table basis (in TableContext, for example)
        final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeNid());
        for (final UnkeyedListEntryNode e : ((UnkeyedListNode) routes).getValue()) {
          final NodeIdentifierWithPredicates routeKey = createRouteKey(e);
          function.apply(tx, base, routeKey, e, attributes);
        }
      } else {
        LOG.warn("Routes {} are not a map", routes);
      }
    }
  }
}
origin: org.opendaylight.controller/sal-rest-connector

private DataContainerChild<?, ?> processUnkeyedListNode(final NormalizedNode<?, ?> node, final Integer depth) {
  CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> newUnkeyedListBuilder = Builders
      .unkeyedListBuilder();
  if (depth > 1) {
    for (UnkeyedListEntryNode oldUnkeyedListEntry : ((UnkeyedListNode) node).getValue()) {
      DataContainerNodeAttrBuilder<NodeIdentifier, UnkeyedListEntryNode> newUnkeyedListEntry = Builders
          .unkeyedListEntryBuilder().withNodeIdentifier(oldUnkeyedListEntry.getIdentifier());
      for (DataContainerChild<? extends PathArgument, ?> oldUnkeyedListEntryValue : oldUnkeyedListEntry
          .getValue()) {
        newUnkeyedListEntry.withChild(pruneDataAtDepth(oldUnkeyedListEntryValue, depth - 1));
      }
      newUnkeyedListBuilder.addChild(newUnkeyedListEntry.build());
    }
  }
  return newUnkeyedListBuilder.build();
}
org.opendaylight.yangtools.yang.data.api.schemaUnkeyedListNodegetValue

Popular methods of UnkeyedListNode

  • getIdentifier
  • getSize

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Reference (javax.naming)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now