You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/06/08 17:49:00 UTC

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

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()