congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DataContainerChild.getNodeType
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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

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();
}
origin: opendaylight/yangtools

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();
}
origin: org.opendaylight.bgpcep/bgp-rib-impl

private boolean isTransitiveAttribute(final DataContainerChild<? extends PathArgument, ?> child) {
  if (child.getIdentifier() instanceof AugmentationIdentifier) {
    final AugmentationIdentifier ai = (AugmentationIdentifier) child.getIdentifier();
    for (final QName name : ai.getPossibleChildNames()) {
      LOG.trace("Augmented QNAME {}", name);
      if (this.transitiveCollection.contains(name)) {
        return true;
      }
    }
    return false;
  }
  if (this.transitiveCollection.contains(child.getNodeType())) {
    return true;
  }
  if (UnrecognizedAttributes.QNAME.equals(child.getNodeType())) {
    final Optional<NormalizedNode<?, ?>> maybeTransitive = NormalizedNodes.findNode(child, this.transitiveLeaf);
    if (maybeTransitive.isPresent()) {
      return (Boolean) maybeTransitive.get().getValue();
    }
  }
  return false;
}
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: 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: 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: 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: 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.yangtools/yang-data-operations

child.getNodeType());
origin: org.opendaylight.yangtools/yang-data-impl

private void validateChildNodeData(final DataContainerChild<?, ?> child, final LeafRefContext referencedByCtx,
    final LeafRefContext referencingCtx, final ModificationType modificationType,
    final YangInstanceIdentifier current) {
  final QName qname = child.getNodeType();
  final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
      : referencedByCtx.getReferencedChildByName(qname);
  final LeafRefContext childReferencingCtx = referencingCtx == null ? null
      : referencingCtx.getReferencingChildByName(qname);
  if (childReferencedByCtx != null || childReferencingCtx != null) {
    validateNodeData(child, childReferencedByCtx, childReferencingCtx, modificationType, current.node(
      child.getIdentifier()));
  }
}
origin: opendaylight/yangtools

private void validateChildNodeData(final DataContainerChild<?, ?> child, final LeafRefContext referencedByCtx,
    final LeafRefContext referencingCtx, final ModificationType modificationType,
    final YangInstanceIdentifier current) {
  final QName qname = child.getNodeType();
  final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
      : referencedByCtx.getReferencedChildByName(qname);
  final LeafRefContext childReferencingCtx = referencingCtx == null ? null
      : referencingCtx.getReferencingChildByName(qname);
  if (childReferencedByCtx != null || childReferencingCtx != null) {
    validateNodeData(child, childReferencedByCtx, childReferencingCtx, modificationType, current.node(
      child.getIdentifier()));
  }
}
origin: opendaylight/yangtools

private void validateChoiceNodeData(final ChoiceNode node, final LeafRefContext referencedByCtx,
    final LeafRefContext referencingCtx, final ModificationType modificationType,
    final YangInstanceIdentifier current) {
  for (final DataContainerChild<?, ?> child : node.getValue()) {
    final QName qname = child.getNodeType();
    final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
        : findReferencedByCtxUnderChoice(referencedByCtx, qname);
    final LeafRefContext childReferencingCtx = referencingCtx == null ? null
        : findReferencingCtxUnderChoice(referencingCtx, qname);
    if (childReferencedByCtx != null || childReferencingCtx != null) {
      validateNodeData(child, childReferencedByCtx, childReferencingCtx, modificationType,
        current.node(child.getIdentifier()));
    }
  }
}
origin: org.opendaylight.yangtools/yang-data-impl

private void validateChoiceNodeData(final ChoiceNode node, final LeafRefContext referencedByCtx,
    final LeafRefContext referencingCtx, final ModificationType modificationType,
    final YangInstanceIdentifier current) {
  for (final DataContainerChild<?, ?> child : node.getValue()) {
    final QName qname = child.getNodeType();
    final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
        : findReferencedByCtxUnderChoice(referencedByCtx, qname);
    final LeafRefContext childReferencingCtx = referencingCtx == null ? null
        : findReferencingCtxUnderChoice(referencingCtx, qname);
    if (childReferencedByCtx != null || childReferencingCtx != null) {
      validateNodeData(child, childReferencedByCtx, childReferencingCtx, modificationType,
        current.node(child.getIdentifier()));
    }
  }
}
origin: org.opendaylight.yangtools/yang-data-api

  return true;
if (!qnames.contains(input.getNodeType())) {
  return true;
origin: opendaylight/yangtools

  return true;
if (!qnames.contains(input.getNodeType())) {
  return true;
org.opendaylight.yangtools.yang.data.api.schemaDataContainerChildgetNodeType

Popular methods of DataContainerChild

  • getValue
  • getIdentifier

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ 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