+
+ /**
+ * Create a new {@link DataTreeModificationCursor} at specified path. May fail
+ * if specified path does not exist.
+ *
+ * @param path Path at which the cursor is to be anchored
+ * @return A new cursor, or empty if the path does not exist.
+ * @throws IllegalStateException if there is another cursor currently open,
+ * or the modification is already {@link #ready()}.
+ */
+ @Override
+ default Optional<? extends DataTreeModificationCursor> openCursor(@Nonnull final YangInstanceIdentifier path) {
+ return Optional.ofNullable(createCursor(path));
+ }
+
+ /**
+ * Create a new {@link DataTreeModificationCursor} at the root of the modification.
+ *
+ * @return A new cursor
+ * @throws IllegalStateException if there is another cursor currently open.
+ */
+ @Override
+ default DataTreeModificationCursor openCursor() {
+ return openCursor(YangInstanceIdentifier.EMPTY).get();
+ }