james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1688126 - /james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
Date Mon, 29 Jun 2015 08:32:38 GMT
Author: btellier
Date: Mon Jun 29 08:32:38 2015
New Revision: 1688126

URL: http://svn.apache.org/r1688126
Log:
MAILBOX-242 Add equals & hashCode methods to MessageRange (generated by Eclipse) - patch
contributed by Antoine Duprat

Modified:
    james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java

Modified: james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java?rev=1688126&r1=1688125&r2=1688126&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
(original)
+++ james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
Mon Jun 29 08:32:38 2015
@@ -165,7 +165,6 @@ public class MessageRange implements Ite
         return "TYPE: " + type + " UID: " + uidFrom + ":" + uidTo;
     }
 
-    
     /**
      * Converts the given {@link Collection} of uids to a {@link List} of {@link MessageRange}
instances
      * 
@@ -298,4 +297,32 @@ public class MessageRange implements Ite
         }
         return ranges;
     }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((type == null) ? 0 : type.hashCode());
+        result = prime * result + (int) (uidFrom ^ (uidFrom >>> 32));
+        result = prime * result + (int) (uidTo ^ (uidTo >>> 32));
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        MessageRange other = (MessageRange) obj;
+        if (type != other.type)
+            return false;
+        if (uidFrom != other.uidFrom)
+            return false;
+        if (uidTo != other.uidTo)
+            return false;
+        return true;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message