*/
protected final boolean processCandidateTree(final @NonNull DataTreeCandidate candidate) {
final DataTreeCandidateNode node = candidate.getRootNode();
- if (node.getModificationType() == ModificationType.UNMODIFIED) {
+ if (node.modificationType() == ModificationType.UNMODIFIED) {
LOG.debug("Skipping unmodified candidate {}", candidate);
return false;
}
final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regNode,
final DataTreeCandidateNode candNode,
final Multimap<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> listenerChanges) {
- if (candNode.getModificationType() == ModificationType.UNMODIFIED) {
+ if (candNode.modificationType() == ModificationType.UNMODIFIED) {
LOG.debug("Skipping unmodified candidate {}", path);
return;
}
- final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> regs = regNode.getRegistrations();
+ final var regs = regNode.getRegistrations();
if (!regs.isEmpty()) {
addToListenerChanges(regs, path, candNode, listenerChanges);
}
- for (DataTreeCandidateNode candChild : candNode.getChildNodes()) {
- if (candChild.getModificationType() != ModificationType.UNMODIFIED) {
- final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regChild =
- regNode.getExactChild(candChild.getIdentifier());
+ for (var candChild : candNode.childNodes()) {
+ if (candChild.modificationType() != ModificationType.UNMODIFIED) {
+ final var regChild = regNode.getExactChild(candChild.name());
if (regChild != null) {
- notifyNode(path.node(candChild.getIdentifier()), regChild, candChild, listenerChanges);
+ notifyNode(path.node(candChild.name()), regChild, candChild, listenerChanges);
}
- for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> rc :
- regNode.getInexactChildren(candChild.getIdentifier())) {
- notifyNode(path.node(candChild.getIdentifier()), rc, candChild, listenerChanges);
+ for (var rc : regNode.getInexactChildren(candChild.name())) {
+ notifyNode(path.node(candChild.name()), rc, candChild, listenerChanges);
}
}
}
import org.opendaylight.yangtools.yang.data.tree.api.ModificationType;
public class AbstractDOMStoreTreeChangePublisherTest extends AbstractDOMStoreTreeChangePublisher {
-
private static boolean removeInvoked = false;
private static boolean notifyInvoked = false;
.node(QName.create("", "node1")).node(QName.create("", "node2")).build();
doReturn(dataTreeCandidateNode).when(dataTreeCandidate).getRootNode();
- doReturn(ModificationType.WRITE).when(dataTreeCandidateNode).getModificationType();
+ doReturn(ModificationType.WRITE).when(dataTreeCandidateNode).modificationType();
doReturn(yangInstanceIdentifier).when(dataTreeCandidate).getRootPath();
- doReturn(ImmutableList.of(dataTreeCandidateNode)).when(dataTreeCandidateNode).getChildNodes();
- doReturn(yangInstanceIdentifier.getLastPathArgument()).when(dataTreeCandidateNode).getIdentifier();
+ doReturn(ImmutableList.of(dataTreeCandidateNode)).when(dataTreeCandidateNode).childNodes();
+ doReturn(yangInstanceIdentifier.getLastPathArgument()).when(dataTreeCandidateNode).name();
final DOMDataTreeChangeListener domDataTreeChangeListener = mock(DOMDataTreeChangeListener.class);
- final AbstractDOMDataTreeChangeListenerRegistration<?> abstractDOMDataTreeChangeListenerRegistration =
- this.registerTreeChangeListener(yangInstanceIdentifier, domDataTreeChangeListener);
+ final var abstractDOMDataTreeChangeListenerRegistration =
+ registerTreeChangeListener(yangInstanceIdentifier, domDataTreeChangeListener);
assertFalse(removeInvoked);
assertFalse(notifyInvoked);
- this.processCandidateTree(dataTreeCandidate);
- doReturn(ModificationType.UNMODIFIED).when(dataTreeCandidateNode).getModificationType();
- this.processCandidateTree(dataTreeCandidate);
+ processCandidateTree(dataTreeCandidate);
+ doReturn(ModificationType.UNMODIFIED).when(dataTreeCandidateNode).modificationType();
+ processCandidateTree(dataTreeCandidate);
abstractDOMDataTreeChangeListenerRegistration.close();