/** * 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(); } }
/** * 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(); } }
private static void applyToCursorAwareModification(final CursorAwareDataTreeModification modification, final DataTreeCandidate candidate) { final YangInstanceIdentifier candidatePath = candidate.getRootPath(); if (candidatePath.isEmpty()) { try (DataTreeModificationCursor cursor = modification.openCursor()) { DataTreeCandidateNodes.applyRootToCursor(cursor, candidate.getRootNode()); } } else { try (DataTreeModificationCursor cursor = modification.openCursor(candidatePath.getParent()).get()) { DataTreeCandidateNodes.applyRootedNodeToCursor(cursor, candidatePath, candidate.getRootNode()); } } }
private static void applyToCursorAwareModification(final CursorAwareDataTreeModification modification, final DataTreeCandidate candidate) { final YangInstanceIdentifier candidatePath = candidate.getRootPath(); if (candidatePath.isEmpty()) { try (DataTreeModificationCursor cursor = modification.openCursor()) { DataTreeCandidateNodes.applyRootToCursor(cursor, candidate.getRootNode()); } } else { try (DataTreeModificationCursor cursor = modification.openCursor(candidatePath.getParent()).get()) { DataTreeCandidateNodes.applyRootedNodeToCursor(cursor, candidatePath, candidate.getRootNode()); } } }