jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1866505 - /jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java
Date Fri, 06 Sep 2019 08:02:37 GMT
Author: kwin
Date: Fri Sep  6 08:02:37 2019
New Revision: 1866505

URL: http://svn.apache.org/viewvc?rev=1866505&view=rev
Log:
trivial: add toString, equals and hashCode to EventImpl

Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java?rev=1866505&r1=1866504&r2=1866505&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/events/impl/PackageEventDispatcherImpl.java
Fri Sep  6 08:02:37 2019
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.vault.packaging.events.impl;
 
+import java.util.Arrays;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -128,6 +129,42 @@ public class PackageEventDispatcherImpl
         public PackageId[] getRelatedIds() {
             return related;
         }
+
+        @Override
+        public String toString() {
+            return "EventImpl [type=" + type + ", id=" + id + ", related=" + Arrays.toString(related)
+ "]";
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((id == null) ? 0 : id.hashCode());
+            result = prime * result + Arrays.hashCode(related);
+            result = prime * result + ((type == null) ? 0 : type.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            EventImpl other = (EventImpl) obj;
+            if (id == null) {
+                if (other.id != null)
+                    return false;
+            } else if (!id.equals(other.id))
+                return false;
+            if (!Arrays.equals(related, other.related))
+                return false;
+            if (type != other.type)
+                return false;
+            return true;
+        }
     }
 
 }



Mime
View raw message