X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FPropertyChange.java;fp=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FPropertyChange.java;h=69256b0381ed7549ed4f4484734b6ddbbf306fc6;hb=ab4fc05981803ce2c430f93f34b8b6a8f85a53ce;hp=25d43592f7491662b349674d0bc80d5d61ce69a8;hpb=7554d449f0cd1c4111b85afd75e8abd6d81f56d6;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java index 25d4359..69256b0 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/PropertyChange.java @@ -16,11 +16,15 @@ public class PropertyChange { public PropertyChange(GraphChanges changes, Statement first, Statement second) { + if (first == null && second == null) + throw new IllegalArgumentException("At least one of the stamenents must be non null."); this.pair = new Pair(first, second); this.changes = changes; } public PropertyChange(GraphChanges changes, Pair change) { + if (change == null || (change.first == null && change.second == null)) + throw new IllegalArgumentException("At least one of the stamenents must be non null."); this.pair = change; this.changes = changes; } @@ -96,4 +100,14 @@ public class PropertyChange { this.visible = visible; } + @Override + public String toString() { + String s = "PropertyChange"; + if (pair.first != null) + s += " (" + (pair.first.getSubject()) + " , " + pair.first.getPredicate() + " , " + pair.first.getObject() + ")"; + if (pair.second != null) + s += " (" + (pair.second.getSubject()) + " , " + pair.second.getPredicate() + " , " + pair.second.getObject() + ")"; + return s; + } + }