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

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

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

origin: org.opendaylight.bgpcep/bgp-evpn

static Integer extractBP(final ContainerNode lan) {
  return (Integer) lan.getChild(RBP_NID).get().getValue();
}
origin: org.opendaylight.yangtools/yang-data-impl

private static void fillQnames(final Iterable<DataContainerChild<? extends PathArgument, ?>> iterable,
    final Map<QName, PathArgument> out) {
  for (final DataContainerChild<? extends PathArgument, ?> childId : iterable) {
    final PathArgument identifier = childId.getIdentifier();
    // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map
    if (isAugment(identifier)) {
      continue;
    }
    out.put(childId.getNodeType(), identifier);
  }
}
origin: io.fd.honeycomb/data-impl

private static AbstractMap.SimpleEntry<YangInstanceIdentifier.PathArgument, DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?>> childMapEntry(
    final DataContainerChild node) {
  return new HashMap.SimpleEntry<YangInstanceIdentifier.PathArgument, DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?>>(
      node.getIdentifier(), node);
}
origin: org.opendaylight.yangtools/yang-data-impl

@Override
public DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> withChild(
    final DataContainerChild<?, ?> child) {
  // Check nested augments
  DataValidationException.checkLegalData(!(child instanceof AugmentationNode),
      "Unable to add: %s, as a child for: %s, Nested augmentations are not permitted", child.getNodeType(),
      getNodeIdentifier() == null ? this : getNodeIdentifier());
  return super.withChild(child);
}
origin: org.opendaylight.yangtools/yang-data-impl

public DataContainerChild<?, ?> validateChild(final DataContainerChild<?, ?> child) {
  validateChild(child.getIdentifier());
  return child;
}
origin: io.fd.honeycomb.infra/test-tools

@Nonnull
@Override
public DataObject getNodeData(@Nonnull YangInstanceIdentifier yangInstanceIdentifier, @Nonnull String resourcePath) {
  final InputStream resourceStream = this.getClass().getResourceAsStream(resourcePath);
  checkState(resourceStream != null, "Resource %s not found", resourcePath);
  final YangInstanceIdentifier nodeParent = getNodeParent(yangInstanceIdentifier).orElse(null);
  final SchemaNode parentSchema = parentSchema(schemaContext(), serializer(), nodeParent, LOG);
  // to be able to process containers in root of model
  if (isRoot(yangInstanceIdentifier)) {
    // if root ,read as root
    final ContainerNode data = readJson(schemaContext(), resourceStream, parentSchema);
    checkState(data.getValue().size() == 1, "Single root expected in %s", resourcePath);
    //then extracts first child
    final QName rootNodeType = data.getValue().iterator().next().getNodeType();
    final YangInstanceIdentifier realIdentifier = YangInstanceIdentifier.of(rootNodeType);
    return nodeBinding(serializer(), realIdentifier, data).getValue();
  } else {
    // reads just container
    final YangInstanceIdentifier.NodeIdentifier nodeIdentifier = containerNodeIdentifier(yangInstanceIdentifier);
    final ContainerNode data = readContainerEntryJson(schemaContext(), resourceStream, parentSchema, nodeIdentifier);
    return nodeBinding(serializer(), yangInstanceIdentifier, data.getValue().iterator().next()).getValue();
  }
}
origin: org.opendaylight.bgpcep/bgp-evpn

static Long extractLD(final ContainerNode cont) {
  return (Long) cont.getChild(LD_NID).get().getValue();
}
origin: opendaylight/yangtools

private static void fillQnames(final Iterable<DataContainerChild<? extends PathArgument, ?>> iterable,
    final Map<QName, PathArgument> out) {
  for (final DataContainerChild<? extends PathArgument, ?> childId : iterable) {
    final PathArgument identifier = childId.getIdentifier();
    // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map
    if (isAugment(identifier)) {
      continue;
    }
    out.put(childId.getNodeType(), identifier);
  }
}
origin: org.opendaylight.yangtools/yang-data-impl

@Override
public DataContainerNodeBuilder<I, R> withChild(final DataContainerChild<?, ?> child) {
  checkDirty();
  this.value.put(child.getIdentifier(), child);
  return this;
}
origin: opendaylight/yangtools

@Override
public DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> withChild(
    final DataContainerChild<?, ?> child) {
  // Check nested augments
  DataValidationException.checkLegalData(!(child instanceof AugmentationNode),
      "Unable to add: %s, as a child for: %s, Nested augmentations are not permitted", child.getNodeType(),
      getNodeIdentifier() == null ? this : getNodeIdentifier());
  return super.withChild(child);
}
origin: org.opendaylight.bgpcep/bgp-evpn

static Integer extractPK(final ContainerNode t1) {
  return (Integer) t1.getChild(PK_NID).get().getValue();
}
origin: org.opendaylight.yangtools/yang-data-impl

@Override
public DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> withChild(
    final DataContainerChild<?, ?> child) {
  // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map
  if (!isAugment(child.getIdentifier())) {
    childrenQNamesToPaths.put(child.getNodeType(), child.getIdentifier());
  }
  return super.withChild(child);
}
origin: org.opendaylight.yangtools/yang-data-operations

private Set<? extends YangInstanceIdentifier.PathArgument> getChildQNames(final Optional<N> actual) {
  Set<YangInstanceIdentifier.PathArgument> qNames = Sets.newLinkedHashSet();
  for (DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?> child : actual.get().getValue()) {
    qNames.add(child.getIdentifier());
  }
  return qNames;
}
origin: org.opendaylight.yangtools/yang-data-operations

child.getNodeType());
origin: org.opendaylight.bgpcep/bgp-rib-impl

private List<Ipv4Prefix> extractPrefixes(final Collection<MapEntryNode> routes) {
  final List<Ipv4Prefix> prefs = new ArrayList<>(routes.size());
  for (final MapEntryNode ipv4Route : routes) {
    final String prefix = (String) ipv4Route.getChild(this.routeKeyLeaf).get().getValue();
    prefs.add(new Ipv4Prefix(prefix));
  }
  return prefs;
}
origin: opendaylight/yangtools

@Override
public DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> withChild(
    final DataContainerChild<?, ?> child) {
  // Augmentation nodes cannot be keys, and do not have to be present in childrenQNamesToPaths map
  if (!isAugment(child.getIdentifier())) {
    childrenQNamesToPaths.put(child.getNodeType(), child.getIdentifier());
  }
  return super.withChild(child);
}
origin: opendaylight/yangtools

@Override
public DataContainerNodeBuilder<I, R> withChild(final DataContainerChild<?, ?> child) {
  checkDirty();
  this.value.put(child.getIdentifier(), child);
  return this;
}
origin: org.opendaylight.yangtools/yang-data-api

  return true;
if (!qnames.contains(input.getNodeType())) {
  return true;
origin: org.opendaylight.bgpcep/bgp-linkstate

private static AsNumber serializeAsNumber(final ContainerNode descriptorsData) {
  final Optional<DataContainerChild<? extends PathArgument, ?>> asNumber = descriptorsData.getChild(AS_NUMBER_NID);
  if (asNumber.isPresent()) {
    return new AsNumber((Long) asNumber.get().getValue());
  }
  return null;
}
origin: org.opendaylight.yangtools/yang-data-impl

public static Optional<CaseSchemaNode> detectCase(final ChoiceSchemaNode schema,
    final DataContainerChild<?, ?> child) {
  for (final CaseSchemaNode choiceCaseNode : schema.getCases().values()) {
    if (child instanceof AugmentationNode
        && belongsToCaseAugment(choiceCaseNode, (AugmentationIdentifier) child.getIdentifier())) {
      return Optional.of(choiceCaseNode);
    } else if (choiceCaseNode.getDataChildByName(child.getNodeType()) != null) {
      return Optional.of(choiceCaseNode);
    }
  }
  return Optional.empty();
}
org.opendaylight.yangtools.yang.data.api.schemaDataContainerChild

Javadoc

Marker interface for direct children of DataContainerNode.

Implementation notes

This interface should not be implemented directly, but rather using one of its subinterfaces:
  • LeafNode
  • ContainerNode
  • ChoiceNode
  • MapNode
  • AugmentationNode

Most used methods

  • getValue
  • getIdentifier
  • getNodeType

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Path (java.nio.file)
  • Permission (java.security)
    Legacy security code; do not use.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Notification (javax.management)
  • 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