import static java.util.Objects.requireNonNull;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
@Override
public String toString() {
- return "NodeModification [identifier=" + identifier + ", modificationType="
- + operation + ", childModification=" + children + "]";
+ final ToStringHelper helper = MoreObjects.toStringHelper(this).omitNullValues()
+ .add("identifier", identifier).add("operation", operation).add("modificationType", modType);
+ if (!children.isEmpty()) {
+ helper.add("childModification", children);
+ }
+ return helper.toString();
}
void resolveModificationType(@Nonnull final ModificationType type) {
inMemoryDataTree.commit(inMemoryDataTree.prepare(treeModification));
} catch (final IllegalArgumentException ex) {
LOG.debug("IllegalArgumentException was thrown as expected", ex);
- assertTrue(ex.getMessage().contains("Metadata not available for modification NodeModification"));
+ assertTrue(ex.getMessage().contains("Metadata not available for modification ModifiedNode"));
}
DataTreeSnapshot snapshotAfterCommits = inMemoryDataTree.takeSnapshot();