use of org.opendaylight.controller.cluster.datastore.node.utils.NormalizedNodeNavigator in project controller by opendaylight.
the class NormalizedNodePrunerTest method countNodes.
private static int countNodes(final NormalizedNode<?, ?> normalizedNode, final String namespaceFilter) {
if (normalizedNode == null) {
return 0;
}
final AtomicInteger count = new AtomicInteger();
new NormalizedNodeNavigator((level, parentPath, normalizedNode1) -> {
if (!(normalizedNode1.getIdentifier() instanceof AugmentationIdentifier)) {
if (normalizedNode1.getIdentifier().getNodeType().getNamespace().toString().contains(namespaceFilter)) {
count.incrementAndGet();
}
}
}).navigate(YangInstanceIdentifier.EMPTY.toString(), normalizedNode);
return count.get();
}
Aggregations