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

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

Best Java code snippets using org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode (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: opendaylight/yangtools

  private static int numOfChildrenFromValue(final NormalizedNode<?, ?> value) {
    if (value instanceof NormalizedNodeContainer) {
      return ((NormalizedNodeContainer<?, ?, ?>) value).getValue().size();
    } else if (value instanceof UnkeyedListNode) {
      return ((UnkeyedListNode) value).getSize();
    }

    throw new IllegalArgumentException(String.format(
        "Unexpected type '%s', expected types are NormalizedNodeContainer and UnkeyedListNode",
        value.getClass()));
  }
}
origin: org.opendaylight.controller/netconf-util

writer.startUnkeyedList(n.getIdentifier(), OrderedNormalizedNodeWriter.childSizeHint(n.getValue()));
return writeChildren(n.getValue(), dataSchemaNode, true);
origin: org.opendaylight.controller/sal-rest-connector

writer.startUnkeyedList(n.getIdentifier(), childSizeHint(n.getValue()));
processedAsCompositeNode = writeChildren(n.getValue());
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.yangtools/yang-data-api

writer.startUnkeyedList(n.getIdentifier(), childSizeHint(n.getValue()));
return writeChildren(n.getValue());
origin: org.opendaylight.yangtools/yang-data-impl

  private static int numOfChildrenFromValue(final NormalizedNode<?, ?> value) {
    if (value instanceof NormalizedNodeContainer) {
      return ((NormalizedNodeContainer<?, ?, ?>) value).getValue().size();
    } else if (value instanceof UnkeyedListNode) {
      return ((UnkeyedListNode) value).getSize();
    }

    throw new IllegalArgumentException(String.format(
        "Unexpected type '%s', expected types are NormalizedNodeContainer and UnkeyedListNode",
        value.getClass()));
  }
}
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: opendaylight/yangtools

writer.startUnkeyedList(n.getIdentifier(), childSizeHint(n.getValue()));
return writeChildren(n.getValue());
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;
}
org.opendaylight.yangtools.yang.data.api.schemaUnkeyedListNode

Javadoc

Containment node, which contains UnkeyedListEntryNode of the same type, which may be quickly retrieved using key.

This node maps to the list statement in YANG schema, which did not define key substatement.

Ordering of the elements is user-defined during construction of instance of this interface. Ordered view of elements (iteration) is provided by #getValue() call.

Most used methods

  • getValue
  • getIdentifier
  • getSize

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Best plugins for Eclipse
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