directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 36768 - incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message
Date Mon, 23 Aug 2004 18:11:02 GMT
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;
     }
 }

Mime
View raw message