- public DataSchemaContextNode<?> getChild(final YangInstanceIdentifier path) {
- DataSchemaContextNode<?> currentOp = root;
- for (PathArgument arg : path.getPathArguments()) {
- currentOp = currentOp.getChild(arg);
- }
- return currentOp;
+ /**
+ * Find a child node as identified by an absolute {@link YangInstanceIdentifier}.
+ *
+ * @param path Path towards the child node
+ * @return Child node if present, or empty when corresponding child is not found.
+ * @throws NullPointerException if {@code path} is null
+ */
+ public @NonNull Optional<@NonNull DataSchemaContextNode<?>> findChild(final @NonNull YangInstanceIdentifier path) {
+ return getRoot().findChild(path);