Author: chetanm
Date: Fri Nov 25 14:20:02 2016
New Revision: 1771321

URL: http://svn.apache.org/viewvc?rev=1771321&view=rev
Log:
OAK-5126 - Support ChangeSet merging and serialization

Add equals and hashcode impl

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeSet.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeSet.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeSet.java?rev=1771321&r1=1771320&r2=1771321&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeSet.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeSet.java
 Fri Nov 25 14:20:02 2016
@@ -53,7 +53,7 @@ import com.google.common.collect.Immutab
  * Naming: note that path, node name and node types all refer to the *parent* 
of
  * a change. While properties naturally are leafs.
  */
-public class ChangeSet {
+public final class ChangeSet {
 
     private final int maxPathDepth;
     private final Set<String> parentPaths;
@@ -116,4 +116,27 @@ public class ChangeSet {
                 getPropertyNames() == null;
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        ChangeSet changeSet = (ChangeSet) o;
+
+        if (maxPathDepth != changeSet.maxPathDepth) return false;
+        if (parentPaths != null ? !parentPaths.equals(changeSet.parentPaths) : 
changeSet.parentPaths != null)
+            return false;
+        if (parentNodeNames != null ? 
!parentNodeNames.equals(changeSet.parentNodeNames) : changeSet.parentNodeNames 
!= null)
+            return false;
+        if (parentNodeTypes != null ? 
!parentNodeTypes.equals(changeSet.parentNodeTypes) : changeSet.parentNodeTypes 
!= null)
+            return false;
+        if (propertyNames != null ? 
!propertyNames.equals(changeSet.propertyNames) : changeSet.propertyNames != 
null)
+            return false;
+        return allNodeTypes != null ? 
allNodeTypes.equals(changeSet.allNodeTypes) : changeSet.allNodeTypes == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return 0;
+    }
 }
\ No newline at end of file


Reply via email to