directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1133444 - /directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
Date Wed, 08 Jun 2011 15:49:00 GMT
Author: elecharny
Date: Wed Jun  8 15:49:00 2011
New Revision: 1133444

URL: http://svn.apache.org/viewvc?rev=1133444&view=rev
Log:
Added a hashCode and equals method (DIRSERVER-1516)

Modified:
    directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java

Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java?rev=1133444&r1=1133443&r2=1133444&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
(original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/messages/ReferenceIdentifier.java
Wed Jun  8 15:49:00 2011
@@ -241,10 +241,43 @@ public class ReferenceIdentifier impleme
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public int compareTo( ReferenceIdentifier that )
     {
         return ordinal - that.ordinal;
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode()
+    {
+        return ordinal;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals( Object that )
+    {
+        if ( that == this )
+        {
+            return true;
+        }
+        
+        if ( ! ( that instanceof ReferenceIdentifier ) )
+        {
+            return false;
+        }
+        
+        ReferenceIdentifier thatRef = (ReferenceIdentifier)that;
+        
+        return ordinal == thatRef.ordinal;
+    }
 
 
     public String toString()



Mime
View raw message