initialSchemaContext, rootSchemaNode, maskMandatory);
}
+ private static DataSchemaNode getRootSchemaNode(final SchemaContext schemaContext,
+ final YangInstanceIdentifier rootPath) {
+ final DataSchemaContextTree contextTree = DataSchemaContextTree.from(schemaContext);
+ final DataSchemaContextNode<?> rootContextNode = contextTree.getChild(rootPath);
+ Preconditions.checkArgument(rootContextNode != null, "Failed to find root %s in schema context", rootPath);
+
+ final DataSchemaNode rootSchemaNode = rootContextNode.getDataSchemaNode();
+ Preconditions.checkArgument(rootSchemaNode instanceof DataNodeContainer,
+ "Root %s resolves to non-container type %s", rootPath, rootSchemaNode);
+ return rootSchemaNode;
+ }
+
private static NormalizedNode<?, ?> createRoot(final DataNodeContainer schemaNode,
final YangInstanceIdentifier path) {
if (path.isEmpty()) {
}
}
- private static DataSchemaNode getRootSchemaNode(final SchemaContext schemaContext,
- final YangInstanceIdentifier rootPath) {
- final DataSchemaContextTree contextTree = DataSchemaContextTree.from(schemaContext);
- final DataSchemaContextNode<?> rootContextNode = contextTree.getChild(rootPath);
- Preconditions.checkArgument(rootContextNode != null, "Failed to find root %s in schema context", rootPath);
-
- final DataSchemaNode rootSchemaNode = rootContextNode.getDataSchemaNode();
- Preconditions.checkArgument(rootSchemaNode instanceof DataNodeContainer,
- "Root %s resolves to non-container type %s", rootPath, rootSchemaNode);
- return rootSchemaNode;
- }
-
private static NormalizedNode<?, ?> createRoot(final YangInstanceIdentifier path) {
if (path.isEmpty()) {
return ROOT_CONTAINER;