import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.yangtools.concepts.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.binding.ChildOf;
import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Identifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
/**
* Represents modification of Data Object.
*
*/
-public interface DataObjectModification<T extends DataObject> extends Identifiable<PathArgument> {
+public interface DataObjectModification<T extends DataObject> extends org.opendaylight.yangtools.concepts.Identifiable<PathArgument> {
enum ModificationType {
/**
*/
@Nonnull Collection<DataObjectModification<? extends DataObject>> getModifiedChildren();
+ /**
+ * Returns container child modification if {@code child} was modified by this
+ * modification.
+ *
+ * For accessing all modified list items consider iterating over {@link #getModifiedChildren()}.
+ *
+ * @param child Type of child - must be only container
+ * @return Modification of {@code child} if {@code child} was modified, null otherwise.
+ * @throws IllegalArgumentException If supplied {@code child} class is not valid child according
+ * to generated model.
+ */
+ @Nullable <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(@Nonnull Class<C> child);
+
+ /**
+ * Returns augmentation child modification if {@code augmentation} was modified by this
+ * modification.
+ *
+ * For accessing all modified list items consider iterating over {@link #getModifiedChildren()}.
+ *
+ * @param augmentation Type of augmentation - must be only container
+ * @return Modification of {@code augmentation} if {@code augmentation} was modified, null otherwise.
+ * @throws IllegalArgumentException If supplied {@code augmentation} class is not valid augmentation
+ * according to generated model.
+ */
+ @Nullable <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(@Nonnull Class<C> augmentation);
+
+
+ /**
+ * Returns child list item modification if {@code child} was modified by this modification.
+ *
+ * @param listItem Type of list item - must be list item with key
+ * @param listKey List item key
+ * @return Modification of {@code child} if {@code child} was modified, null otherwise.
+ * @throws IllegalArgumentException If supplied {@code listItem} class is not valid child according
+ * to generated model.
+ */
+ <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(
+ @Nonnull Class<C> listItem,@Nonnull K listKey);
+
+ /**
+ * Returns a child modification if a node identified by {@code childArgument} was modified by
+ * this modification.
+ *
+ * @param childArgument Path Argument of child node
+ * @return Modification of child identified by {@code childArgument} if {@code childArgument}
+ * was modified, null otherwise.
+ * @throws IllegalArgumentException If supplied path argument is not valid child according to
+ * generated model.
+ *
+ */
+ @Nullable DataObjectModification<? extends DataObject> getModifiedChild(PathArgument childArgument);
}
import java.util.Collection;
import java.util.EventListener;
import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* Interface implemented by classes interested in receiving notifications about
* in that it provides a cursor-based view of the change, which has potentially
* lower overhead and allow more flexible consumption of change event.
*/
-public interface DataTreeChangeListener extends EventListener {
+public interface DataTreeChangeListener<T extends DataObject> extends EventListener {
/**
* Invoked when there was data change for the supplied path, which was used
* to register this listener.
*
* @param changes Collection of change events, may not be null or empty.
*/
- void onDataTreeChanged(@Nonnull Collection<DataTreeModification> changes);
+ void onDataTreeChanged(@Nonnull Collection<DataTreeModification<T>> changes);
}
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* A {@link DOMService} which allows users to register for changes to a
* your listener using {@link ListenerRegistration#close()} to stop
* delivery of change events.
*/
- @Nonnull <L extends DataTreeChangeListener> ListenerRegistration<L> registerDataTreeChangeListener(@Nonnull DataTreeIdentifier treeId, @Nonnull L listener);
+ @Nonnull <T extends DataObject,L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener(@Nonnull DataTreeIdentifier<T> treeId, @Nonnull L listener);
}
\ No newline at end of file
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.concepts.Path;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* A unique identifier for a particular subtree. It is composed of the logical
* data store type and the instance identifier of the root node.
*/
-public final class DataTreeIdentifier implements Immutable, Path<DataTreeIdentifier>, Serializable {
+public final class DataTreeIdentifier<T extends DataObject> implements Immutable, Path<DataTreeIdentifier<?>>, Serializable {
private static final long serialVersionUID = 1L;
- private final InstanceIdentifier<?> rootIdentifier;
+ private final InstanceIdentifier<T> rootIdentifier;
private final LogicalDatastoreType datastoreType;
- public DataTreeIdentifier(final LogicalDatastoreType datastoreType, final InstanceIdentifier<?> rootIdentifier) {
+ public DataTreeIdentifier(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> rootIdentifier) {
this.datastoreType = Preconditions.checkNotNull(datastoreType);
this.rootIdentifier = Preconditions.checkNotNull(rootIdentifier);
}
}
@Override
- public boolean contains(final DataTreeIdentifier other) {
+ public boolean contains(final DataTreeIdentifier<?> other) {
return datastoreType == other.datastoreType && rootIdentifier.contains(other.rootIdentifier);
}
if (!(obj instanceof DataTreeIdentifier)) {
return false;
}
- DataTreeIdentifier other = (DataTreeIdentifier) obj;
+ final DataTreeIdentifier<?> other = (DataTreeIdentifier<?>) obj;
if (datastoreType != other.datastoreType) {
return false;
}
* @author Tony Tkacik <ttkacik@cisco.com>
*
*/
-public interface DataTreeModification {
+public interface DataTreeModification<T extends DataObject> {
/**
* Get the modification root path. This is the path of the root node
*
* @return absolute path of the root node
*/
- @Nonnull DataTreeIdentifier getRootPath();
+ @Nonnull DataTreeIdentifier<T> getRootPath();
/**
* Get the modification root node.
*
* @return modification root node
*/
- @Nonnull DataObjectModification<? extends DataObject> getRootNode();
+ @Nonnull DataObjectModification<T> getRootNode();
}
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
/**
* to their Binding equivalent.
*
*/
-final class BindingDOMDataTreeChangeListenerAdapter implements DOMDataTreeChangeListener {
+final class BindingDOMDataTreeChangeListenerAdapter<T extends DataObject> implements DOMDataTreeChangeListener {
private final BindingToNormalizedNodeCodec codec;
- private final DataTreeChangeListener listener;
+ private final DataTreeChangeListener<T> listener;
private final LogicalDatastoreType store;
BindingDOMDataTreeChangeListenerAdapter(final BindingToNormalizedNodeCodec codec, final DataTreeChangeListener listener,
@Override
public void onDataTreeChanged(final Collection<DataTreeCandidate> domChanges) {
- final Collection<DataTreeModification> bindingChanges = LazyDataTreeModification.from(codec, domChanges, store);
+ final Collection<DataTreeModification<T>> bindingChanges = LazyDataTreeModification.from(codec, domChanges, store);
listener.onDataTreeChanged(bindingChanges);
}
}
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeIdentifier;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
}
@Override
- public <L extends DataTreeChangeListener> ListenerRegistration<L> registerDataTreeChangeListener(
- final DataTreeIdentifier treeId, final L listener) {
+ public <T extends DataObject, L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener(
+ final DataTreeIdentifier<T> treeId, final L listener) {
final DOMDataTreeIdentifier domIdentifier = toDomTreeIdentifier(treeId);
- final BindingDOMDataTreeChangeListenerAdapter domListener = new BindingDOMDataTreeChangeListenerAdapter(codec,listener, treeId.getDatastoreType());
- final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter> domReg = dataTreeChangeService.registerDataTreeChangeListener(domIdentifier, domListener);
+ final BindingDOMDataTreeChangeListenerAdapter<T> domListener = new BindingDOMDataTreeChangeListenerAdapter<>(codec,listener, treeId.getDatastoreType());
+ final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter<T>> domReg = dataTreeChangeService.registerDataTreeChangeListener(domIdentifier, domListener);
return new BindingDataTreeChangeListenerRegistration<>(listener,domReg);
}
- private DOMDataTreeIdentifier toDomTreeIdentifier(final DataTreeIdentifier treeId) {
+ private DOMDataTreeIdentifier toDomTreeIdentifier(final DataTreeIdentifier<?> treeId) {
final YangInstanceIdentifier domPath = codec.toYangInstanceIdentifier(treeId.getRootIdentifier());
return new DOMDataTreeIdentifier(treeId.getDatastoreType(), domPath);
}
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
-class BindingDataTreeChangeListenerRegistration<L extends DataTreeChangeListener> extends AbstractListenerRegistration<L> {
+class BindingDataTreeChangeListenerRegistration<L extends DataTreeChangeListener<?>> extends AbstractListenerRegistration<L> {
- private final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter> domReg;
+ private final ListenerRegistration<?> domReg;
- BindingDataTreeChangeListenerRegistration(final L listener,
- final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter> domReg) {
+ BindingDataTreeChangeListenerRegistration(final L listener, final ListenerRegistration<?> domReg) {
super(listener);
this.domReg = Preconditions.checkNotNull(domReg);
}
import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.yangtools.binding.data.codec.api.BindingCodecTreeNode;
+import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.ChildOf;
import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Identifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
this.identifier = codec.deserializePathArgument(domData.getIdentifier());
}
- static DataObjectModification<? extends DataObject> create(final BindingCodecTreeNode<?> codec,
+ static <T extends DataObject> DataObjectModification<T> create(final BindingCodecTreeNode<T> codec,
final DataTreeCandidateNode domData) {
return new LazyDataObjectModification<>(codec,domData);
}
return childNodesCache;
}
+ @Override
public DataObjectModification<? extends DataObject> getModifiedChild(final PathArgument arg) {
final List<YangInstanceIdentifier.PathArgument> domArgumentList = new ArrayList<>();
final BindingCodecTreeNode<?> childCodec = codec.bindingPathArgumentChild(arg, domArgumentList);
return null;
}
+ @Override
+ @SuppressWarnings("unchecked")
+ public <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(
+ final Class<C> listItem, final K listKey) {
+ return (DataObjectModification<C>) getModifiedChild(new InstanceIdentifier.IdentifiableItem<>(listItem, listKey));
+ }
+
+ @Override
@SuppressWarnings("unchecked")
- public <C extends ChildOf<T>> DataObjectModification<C> getModifiedChild(final Class<C> arg) {
+ public <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(final Class<C> arg) {
return (DataObjectModification<C>) getModifiedChild(new InstanceIdentifier.Item<>(arg));
}
+ @Override
+ @SuppressWarnings("unchecked")
+ public <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(
+ final Class<C> augmentation) {
+ return (DataObjectModification<C>) getModifiedChild(new InstanceIdentifier.Item<>(augmentation));
+ }
+
private T deserialize(final Optional<NormalizedNode<?, ?>> dataAfter) {
if(dataAfter.isPresent()) {
return codec.deserialize(dataAfter.get());
* which are directly accessed by user of data object modification.
*
*/
-class LazyDataTreeModification implements DataTreeModification {
+class LazyDataTreeModification<T extends DataObject> implements DataTreeModification<T> {
- private final DataTreeIdentifier path;
- private final DataObjectModification<?> rootNode;
+ private final DataTreeIdentifier<T> path;
+ private final DataObjectModification<T> rootNode;
- LazyDataTreeModification(final LogicalDatastoreType datastoreType, final InstanceIdentifier<?> path, final BindingCodecTreeNode<?> codec, final DataTreeCandidate domChange) {
- this.path = new DataTreeIdentifier(datastoreType, path);
+ LazyDataTreeModification(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> path, final BindingCodecTreeNode<T> codec, final DataTreeCandidate domChange) {
+ this.path = new DataTreeIdentifier<>(datastoreType, path);
this.rootNode = LazyDataObjectModification.create(codec, domChange.getRootNode());
}
@Override
- public DataObjectModification<? extends DataObject> getRootNode() {
+ public DataObjectModification<T> getRootNode() {
return rootNode;
}
@Override
- public DataTreeIdentifier getRootPath() {
+ public DataTreeIdentifier<T> getRootPath() {
return path;
}
- static DataTreeModification create(final BindingToNormalizedNodeCodec codec, final DataTreeCandidate domChange,
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ static <T extends DataObject> DataTreeModification<T> create(final BindingToNormalizedNodeCodec codec, final DataTreeCandidate domChange,
final LogicalDatastoreType datastoreType) {
final Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>> codecCtx =
codec.getSubtreeCodec(domChange.getRootPath());
- return new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
+ return (DataTreeModification<T>) new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
}
- static Collection<DataTreeModification> from(final BindingToNormalizedNodeCodec codec,
+ static <T extends DataObject> Collection<DataTreeModification<T>> from(final BindingToNormalizedNodeCodec codec,
final Collection<DataTreeCandidate> domChanges, final LogicalDatastoreType datastoreType) {
- final List<DataTreeModification> result = new ArrayList<>(domChanges.size());
+ final List<DataTreeModification<T>> result = new ArrayList<>(domChanges.size());
for (final DataTreeCandidate domChange : domChanges) {
- result.add(create(codec, domChange, datastoreType));
+ result.add(LazyDataTreeModification.<T>create(codec, domChange, datastoreType));
}
return result;
}
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_BAR_KEY;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.TOP_FOO_KEY;
import static org.opendaylight.controller.md.sal.test.model.util.ListsBindingUtils.USES_ONE_KEY;
public class DataTreeChangeListenerTest extends AbstractDataBrokerTest {
private static final InstanceIdentifier<Top> TOP_PATH = InstanceIdentifier.create(Top.class);
+ private static final PathArgument TOP_ARGUMENT= TOP_PATH.getPathArguments().iterator().next();
private static final InstanceIdentifier<TopLevelList> FOO_PATH = path(TOP_FOO_KEY);
private static final PathArgument FOO_ARGUMENT = Iterables.getLast(FOO_PATH.getPathArguments());
private static final TopLevelList FOO_DATA = topLevelList(TOP_FOO_KEY, complexUsesAugment(USES_ONE_KEY));
private static final InstanceIdentifier<TopLevelList> BAR_PATH = path(TOP_BAR_KEY);
private static final PathArgument BAR_ARGUMENT = Iterables.getLast(BAR_PATH.getPathArguments());
private static final TopLevelList BAR_DATA = topLevelList(TOP_BAR_KEY);
- private static final DataTreeIdentifier TOP_IDENTIFIER = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL,
+private static final DataTreeIdentifier<Top> TOP_IDENTIFIER = new DataTreeIdentifier<Top>(LogicalDatastoreType.OPERATIONAL,
TOP_PATH);
private static final Top TOP_INITIAL_DATA = top(FOO_DATA);
private BindingDOMDataBrokerAdapter dataBrokerImpl;
- private static final class EventCapturingListener implements DataTreeChangeListener {
+ private static final class EventCapturingListener<T extends DataObject> implements DataTreeChangeListener<T> {
- private SettableFuture<Collection<DataTreeModification>> changes = SettableFuture.create();
+ private SettableFuture<Collection<DataTreeModification<T>>> changes = SettableFuture.create();
@Override
- public void onDataTreeChanged(final Collection<DataTreeModification> changes) {
+ public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
this.changes.set(changes);
}
- Collection<DataTreeModification> nextEvent() throws Exception {
- final Collection<DataTreeModification> result = changes.get(200,TimeUnit.MILLISECONDS);
+ Collection<DataTreeModification<T>> nextEvent() throws Exception {
+ final Collection<DataTreeModification<T>> result = changes.get(200,TimeUnit.MILLISECONDS);
changes = SettableFuture.create();
return result;
}
@Test
public void testTopLevelListener() throws Exception {
- final EventCapturingListener listener = new EventCapturingListener();
+ final EventCapturingListener<Top> listener = new EventCapturingListener<>();
dataBrokerImpl.registerDataTreeChangeListener(TOP_IDENTIFIER, listener);
createAndVerifyTop(listener);
putTx(BAR_PATH, BAR_DATA).submit().checkedGet();
- final DataTreeModification afterBarPutEvent = Iterables.getOnlyElement(listener.nextEvent());
- final DataObjectModification<? extends DataObject> barPutMod =
- getOnlyChildModification(afterBarPutEvent.getRootNode(), ModificationType.SUBTREE_MODIFIED);
+ final DataObjectModification<Top> afterBarPutEvent = Iterables.getOnlyElement(listener.nextEvent()).getRootNode();
+ verifyModification(afterBarPutEvent, TOP_ARGUMENT, ModificationType.SUBTREE_MODIFIED);
+ final DataObjectModification<TopLevelList> barPutMod = afterBarPutEvent.getModifiedChildListItem(TopLevelList.class, TOP_BAR_KEY);
+ assertNotNull(barPutMod);
verifyModification(barPutMod, BAR_ARGUMENT, ModificationType.WRITE);
deleteTx(BAR_PATH).submit().checkedGet();
- final DataTreeModification afterBarDeleteEvent = Iterables.getOnlyElement(listener.nextEvent());
- final DataObjectModification<? extends DataObject> barDeleteMod =
- getOnlyChildModification(afterBarDeleteEvent.getRootNode(), ModificationType.SUBTREE_MODIFIED);
+ final DataObjectModification<Top> afterBarDeleteEvent = Iterables.getOnlyElement(listener.nextEvent()).getRootNode();
+ verifyModification(afterBarDeleteEvent, TOP_ARGUMENT, ModificationType.SUBTREE_MODIFIED);
+ final DataObjectModification<TopLevelList> barDeleteMod = afterBarDeleteEvent.getModifiedChildListItem(TopLevelList.class, TOP_BAR_KEY);
verifyModification(barDeleteMod, BAR_ARGUMENT, ModificationType.DELETE);
}
@Test
public void testWildcardedListListener() throws Exception {
- final EventCapturingListener listener = new EventCapturingListener();
- final DataTreeIdentifier wildcard = new DataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, TOP_PATH.child(TopLevelList.class));
+ final EventCapturingListener<TopLevelList> listener = new EventCapturingListener<>();
+ final DataTreeIdentifier<TopLevelList> wildcard = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, TOP_PATH.child(TopLevelList.class));
dataBrokerImpl.registerDataTreeChangeListener(wildcard, listener);
putTx(TOP_PATH, TOP_INITIAL_DATA).submit().checkedGet();
- final DataTreeModification fooWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
+ final DataTreeModification<TopLevelList> fooWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
assertEquals(FOO_PATH, fooWriteEvent.getRootPath().getRootIdentifier());
verifyModification(fooWriteEvent.getRootNode(), FOO_ARGUMENT, ModificationType.WRITE);
putTx(BAR_PATH, BAR_DATA).submit().checkedGet();
- final DataTreeModification barWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
+ final DataTreeModification<TopLevelList> barWriteEvent = Iterables.getOnlyElement(listener.nextEvent());
assertEquals(BAR_PATH, barWriteEvent.getRootPath().getRootIdentifier());
verifyModification(barWriteEvent.getRootNode(), BAR_ARGUMENT, ModificationType.WRITE);
deleteTx(BAR_PATH).submit().checkedGet();
- final DataTreeModification barDeleteEvent = Iterables.getOnlyElement(listener.nextEvent());
+ final DataTreeModification<TopLevelList> barDeleteEvent = Iterables.getOnlyElement(listener.nextEvent());
assertEquals(BAR_PATH, barDeleteEvent.getRootPath().getRootIdentifier());
verifyModification(barDeleteEvent.getRootNode(), BAR_ARGUMENT, ModificationType.DELETE);
}
- private void createAndVerifyTop(final EventCapturingListener listener) throws Exception {
+ private void createAndVerifyTop(final EventCapturingListener<Top> listener) throws Exception {
putTx(TOP_PATH,TOP_INITIAL_DATA).submit().checkedGet();
- final Collection<DataTreeModification> events = listener.nextEvent();
+ final Collection<DataTreeModification<Top>> events = listener.nextEvent();
assertFalse("Non empty collection should be received.",events.isEmpty());
- final DataTreeModification initialWrite = Iterables.getOnlyElement(events);
+ final DataTreeModification<Top> initialWrite = Iterables.getOnlyElement(events);
final DataObjectModification<? extends DataObject> initialNode = initialWrite.getRootNode();
verifyModification(initialNode,TOP_PATH.getPathArguments().iterator().next(),ModificationType.WRITE);
assertEquals(TOP_INITIAL_DATA, initialNode.getDataAfter());
}
- private DataObjectModification<? extends DataObject> getOnlyChildModification(final DataObjectModification<? extends DataObject> parentMod,final DataObjectModification.ModificationType eventType) throws Exception {
- assertEquals(eventType,parentMod.getModificationType());
- final Collection<DataObjectModification<? extends DataObject>> childMod = parentMod.getModifiedChildren();
- assertFalse("Non empty children modification",childMod.isEmpty());
- return Iterables.getOnlyElement(childMod);
- }
-
private void verifyModification(final DataObjectModification<? extends DataObject> barWrite, final PathArgument pathArg,
final ModificationType eventType) {
assertEquals(pathArg.getType(), barWrite.getDataType());