X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FPropertyDiff.java;fp=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FPropertyDiff.java;h=0000000000000000000000000000000000000000;hb=623a0db2d0f161c101b9e41abcaccc04d478d32a;hp=71e76fe9ba6ad86c3f9bbfae64c8616e5768eaf6;hpb=46cc2039ac20703c484aa994b830a2da113f2c97;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.jcr/src/org/argeo/jcr/PropertyDiff.java b/org.argeo.jcr/src/org/argeo/jcr/PropertyDiff.java deleted file mode 100644 index 71e76fe9b..000000000 --- a/org.argeo.jcr/src/org/argeo/jcr/PropertyDiff.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.argeo.jcr; - -import javax.jcr.Value; - -/** The result of the comparison of two JCR properties. */ -public class PropertyDiff { - public final static Integer MODIFIED = 0; - public final static Integer ADDED = 1; - public final static Integer REMOVED = 2; - - private final Integer type; - private final String relPath; - private final Value referenceValue; - private final Value newValue; - - public PropertyDiff(Integer type, String relPath, Value referenceValue, Value newValue) { - super(); - - if (type == MODIFIED) { - if (referenceValue == null || newValue == null) - throw new IllegalArgumentException("Reference and new values must be specified."); - } else if (type == ADDED) { - if (referenceValue != null || newValue == null) - throw new IllegalArgumentException("New value and only it must be specified."); - } else if (type == REMOVED) { - if (referenceValue == null || newValue != null) - throw new IllegalArgumentException("Reference value and only it must be specified."); - } else { - throw new IllegalArgumentException("Unkown diff type " + type); - } - - if (relPath == null) - throw new IllegalArgumentException("Relative path must be specified"); - - this.type = type; - this.relPath = relPath; - this.referenceValue = referenceValue; - this.newValue = newValue; - } - - public Integer getType() { - return type; - } - - public String getRelPath() { - return relPath; - } - - public Value getReferenceValue() { - return referenceValue; - } - - public Value getNewValue() { - return newValue; - } - -}