.build()));
}
- private static NormalizedNode<?, ?> prune(final NormalizedNode<?, ?> node) throws IOException {
- final ReusableNormalizedNodePruner pruner = ReusableNormalizedNodePruner.forSchemaContext(CONTEXT)
- .withUintAdaption();
- pruner.initializeForPath(YangInstanceIdentifier.create(node.getIdentifier()));
+ private static NormalizedNode prune(final NormalizedNode node) throws IOException {
+ final var pruner = ReusableNormalizedNodePruner.forSchemaContext(CONTEXT).withUintAdaption();
+ pruner.initializeForPath(YangInstanceIdentifier.of(node.name()));
try (NormalizedNodeWriter writer = NormalizedNodeWriter.forStreamWriter(pruner)) {
writer.write(node);
}
pruner.close();
- return pruner.getResult().get();
+ return pruner.getResult().orElseThrow();
}
}