import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Identifiable;
-import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
/**
* data. Nevertheless, this interface should be named 'NormalizedData'.
*/
public interface NormalizedNode extends Identifiable<PathArgument> {
- /**
- * QName of the node as defined in YANG schema.
- *
- * @return QName of this node, non-null.
- */
- // FIXME: YANGTOOLS-1074: eliminate this method: the problem is that it does not work with AugmentationIdentifier
- // At least we need a 'QNameModule namespace()' method, as that is the common contract.
- @Deprecated(forRemoval = true)
- default @NonNull QName getNodeType() {
- return getIdentifier().getNodeType();
- }
-
@Override
// We override here, so that NormalizedNode.getIdentifier() has fewer implementations
PathArgument getIdentifier();
final LeafRefContext referencingCtx, final ModificationType modificationType,
final YangInstanceIdentifier current) {
for (final DataContainerChild child : node.body()) {
- final QName qname = child.getNodeType();
+ final QName qname = child.getIdentifier().getNodeType();
final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
: findReferencedByCtxUnderChoice(referencedByCtx, qname);
final LeafRefContext childReferencingCtx = referencingCtx == null ? null
private void validateChildNodeData(final DataContainerChild child, final LeafRefContext referencedByCtx,
final LeafRefContext referencingCtx, final ModificationType modificationType,
final YangInstanceIdentifier current) {
- final QName qname = child.getNodeType();
+ final QName qname = child.getIdentifier().getNodeType();
final LeafRefContext childReferencedByCtx = referencedByCtx == null ? null
: referencedByCtx.getReferencedChildByName(qname);
final LeafRefContext childReferencingCtx = referencingCtx == null ? null
LOG.debug("Invalid leafref value [{}] allowed values {} by validation of leafref TARGET node: {} path "
+ "of invalid LEAFREF node: {} leafRef target path: {} {}", leafRefsValue,
- leafRefTargetNodeValues, leaf.getNodeType(), leafRefContext.getCurrentNodePath(),
+ leafRefTargetNodeValues, leaf.getIdentifier(), leafRefContext.getCurrentNodePath(),
leafRefContext.getAbsoluteLeafRefTargetPath(), FAILED);
errorsMessages.add(String.format("Invalid leafref value [%s] allowed values %s by validation of leafref"
+ " TARGET node: %s path of invalid LEAFREF node: %s leafRef target path: %s %s", leafRefsValue,
- leafRefTargetNodeValues, leaf.getNodeType(), leafRefContext.getCurrentNodePath(),
+ leafRefTargetNodeValues, leaf.getIdentifier(), leafRefContext.getCurrentNodePath(),
leafRefContext.getAbsoluteLeafRefTargetPath(),
FAILED));
});
LOG.debug("Operation [{}] validate data of LEAFREF node: name[{}] = value[{}] {}", modificationType,
referencingCtx.getNodeName(), leaf.body(), FAILED);
LOG.debug("Invalid leafref value [{}] allowed values {} of LEAFREF node: {} leafRef target path: {}",
- leaf.body(), values, leaf.getNodeType(), referencingCtx.getAbsoluteLeafRefTargetPath());
+ leaf.body(), values, leaf.getIdentifier(), referencingCtx.getAbsoluteLeafRefTargetPath());
errorsMessages.add(String.format("Invalid leafref value [%s] allowed values %s of LEAFREF node: %s leafRef "
- + "target path: %s", leaf.body(), values, leaf.getNodeType(),
+ + "target path: %s", leaf.body(), values, leaf.getIdentifier(),
referencingCtx.getAbsoluteLeafRefTargetPath()));
}
.build();
final UnkeyedListEntryNode unkeyedListEntryNodeNode = ImmutableUnkeyedListEntryNodeBuilder
.create(unkeyedListEntryNode).build();
- assertEquals(unkeyedListEntryNode.getNodeType().getLocalName(), unkeyedListEntryNodeSize.getNodeType()
- .getLocalName());
- assertEquals(unkeyedListEntryNodeSize.getNodeType().getLocalName(), unkeyedListEntryNodeNode.getNodeType()
- .getLocalName());
+ assertEquals(unkeyedListEntryNode.getIdentifier(), unkeyedListEntryNodeSize.getIdentifier());
+ assertEquals(unkeyedListEntryNodeSize.getIdentifier(), unkeyedListEntryNodeNode.getIdentifier());
}
@Test
assertNotNull(unkeyedListNodeSize.body());
assertEquals(unkeyedListEntryNode, unkeyedListNodeCreated.childAt(0));
- assertEquals(unkeyedListNode.getNodeType().getLocalName(), unkeyedListNodeSize.getNodeType().getLocalName());
+ assertEquals(unkeyedListNode.getIdentifier(), unkeyedListNodeSize.getIdentifier());
assertNotNull(unkeyedListNodeCreated);
}