@Override public boolean equals(Object o) { if (!(o instanceof GeometryAttributeDiff)) { return false; } GeometryAttributeDiff d = (GeometryAttributeDiff) o; if (oldGeometry == null && newGeometry == null) { return d.oldGeometry == null && d.newGeometry == null && Objects.equal(type, d.type); } else { return diff.equals(d.diff); } }
@Override public boolean equals(Object o) { if (!(o instanceof GeometryAttributeDiff)) { return false; } GeometryAttributeDiff d = (GeometryAttributeDiff) o; if (oldGeometry == null && newGeometry == null) { return d.oldGeometry == null && d.newGeometry == null && Objects.equal(type, d.type); } else { return diff.equals(d.diff); } }
@Override public boolean conflicts(AttributeDiff ad) { if (!(ad instanceof GeometryAttributeDiff)) { return true; } final GeometryAttributeDiff gad = (GeometryAttributeDiff) ad; final TYPE myType = getType(); final TYPE otherType = ad.getType(); // if either side of the diff is a no change, then there's no conflict, regardless of the // type of the other side if (NO_CHANGE == myType || NO_CHANGE == otherType) { return false; } if (REMOVED == myType && REMOVED == otherType) { return false; } if (MODIFIED == myType && MODIFIED == otherType) { if (gad.diff.equals(diff)) { return false; } else { return true; } } if (ADDED == myType && ADDED == otherType) { return !gad.newGeometry.equalsExact(newGeometry); } return true; }
@Override public boolean conflicts(AttributeDiff ad) { if (!(ad instanceof GeometryAttributeDiff)) { return true; } final GeometryAttributeDiff gad = (GeometryAttributeDiff) ad; final TYPE myType = getType(); final TYPE otherType = ad.getType(); // if either side of the diff is a no change, then there's no conflict, regardless of the // type of the other side if (NO_CHANGE == myType || NO_CHANGE == otherType) { return false; } if (REMOVED == myType && REMOVED == otherType) { return false; } if (MODIFIED == myType && MODIFIED == otherType) { if (gad.diff.equals(diff)) { return false; } else { return true; } } if (ADDED == myType && ADDED == otherType) { return !gad.newGeometry.equalsExact(newGeometry); } return true; }