@Override public boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof AbstractDocumentNodeState) { AbstractDocumentNodeState other = (AbstractDocumentNodeState) that; if (!getPath().equals(other.getPath())) { // path does not match: not equals // (even if the properties are equal) return false; } if (revisionEquals(other)) { return true; } // revision does not match: might still be equals } else if (that instanceof ModifiedNodeState) { ModifiedNodeState modified = (ModifiedNodeState) that; if (modified.getBaseState() == this) { return EqualsDiff.equals(this, modified); } } if (that instanceof NodeState) { return AbstractNodeState.equals(this, (NodeState) that); } return false; }
@Override public boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof AbstractDocumentNodeState) { AbstractDocumentNodeState other = (AbstractDocumentNodeState) that; if (!getPath().equals(other.getPath())) { // path does not match: not equals // (even if the properties are equal) return false; } if (revisionEquals(other)) { return true; } // revision does not match: might still be equals } else if (that instanceof ModifiedNodeState) { ModifiedNodeState modified = (ModifiedNodeState) that; if (modified.getBaseState() == this) { return EqualsDiff.equals(this, modified); } } if (that instanceof NodeState) { return AbstractNodeState.equals(this, (NodeState) that); } return false; }
@Override public boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof AbstractDocumentNodeState) { AbstractDocumentNodeState other = (AbstractDocumentNodeState) that; if (!base.getPath().equals(other.getPath())) { // path does not match: not equals // (even if the properties are equal) return false; } if (revisionEquals(base, other)) { // other is equal to our base state // perform an equals diff with base and modified return EqualsDiff.equals(base, modified); } // revision does not match: might still be equals } else if (that instanceof ModifiedNodeState) { ModifiedNodeState modified = (ModifiedNodeState) that; if (modified.getBaseState() == base) { // base states are the same, compare the modified return EqualsDiff.equals(this.modified, modified); } } if (that instanceof NodeState) { return AbstractNodeState.equals(modified, (NodeState) that); } return false; }
@Override public boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof AbstractDocumentNodeState) { AbstractDocumentNodeState other = (AbstractDocumentNodeState) that; if (!base.getPath().equals(other.getPath())) { // path does not match: not equals // (even if the properties are equal) return false; } if (revisionEquals(base, other)) { // other is equal to our base state // perform an equals diff with base and modified return EqualsDiff.equals(base, modified); } // revision does not match: might still be equals } else if (that instanceof ModifiedNodeState) { ModifiedNodeState modified = (ModifiedNodeState) that; if (modified.getBaseState() == base) { // base states are the same, compare the modified return EqualsDiff.equals(this.modified, modified); } } if (that instanceof NodeState) { return AbstractNodeState.equals(modified, (NodeState) that); } return false; }
beforeId = deduplicateNode(after.getBaseState());