You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/08/23 20:11:02 UTC

svn commit: rev 36768 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message

Author: akarasulu
Date: Mon Aug 23 11:11:01 2004
New Revision: 36768

Modified:
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindRequestImpl.java
Log:
Commit changes ...

 o formatting: removed m_, a_ and space before ;
 o added equals method
 


Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindRequestImpl.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindRequestImpl.java	(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/BindRequestImpl.java	Mon Aug 23 11:11:01 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.ldap.common.message ;
 
+import org.apache.commons.lang.ArrayUtils;
+
 
 /**
  * Bind protocol operation request which authenticates and begins a client
@@ -221,5 +223,49 @@
     public MessageTypeEnum getResponseType()
     {
         return RESP_TYPE ;
+    }
+
+
+    public boolean equals( Object obj )
+    {
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( ! ( obj instanceof BindRequest ) )
+        {
+            return false;
+        }
+
+        BindRequest req = ( BindRequest ) obj;
+
+        if ( getMessageId() != req.getMessageId() )
+        {
+            return false;
+        }
+
+        if ( req.isSimple() != isSimple() )
+        {
+            return false;
+        }
+
+        if ( req.isVersion3() != isVersion3() )
+        {
+            return false;
+        }
+
+        if ( ! req.getName().equals( getName() ) )
+        {
+            return false;
+        }
+
+        if ( ! ArrayUtils.isEquals( req.getCredentials(), getCredentials() ) )
+        {
+            return false;
+        }
+
+
+        return true;
     }
 }