directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r349424 - /directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
Date Mon, 28 Nov 2005 16:47:55 GMT
Author: elecharny
Date: Mon Nov 28 08:47:42 2005
New Revision: 349424

URL: http://svn.apache.org/viewcvs?rev=349424&view=rev
Log:
added a toString method for debugging purpose

Modified:
    directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java

Modified: directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java?rev=349424&r1=349423&r2=349424&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
(original)
+++ directory/shared/ldap/trunk/common/src/main/java/org/apache/ldap/common/message/ReferralImpl.java
Mon Nov 28 08:47:42 2005
@@ -141,4 +141,32 @@
 
         return false;
     }
+    
+    /**
+     * Get a String representation of a LdapResult
+     *
+     * @return A LdapResult String 
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        if ( ( urls != null ) && ( urls.size() != 0 ) )
+        {
+            sb.append( "            Referrals :\n" );
+
+            Object[] urlsArray = urls.toArray();
+            
+            for ( int i = 0; i < urlsArray.length; i++ )
+            {
+
+                String referral = ( String ) urlsArray[ i ];
+
+                sb.append( "                Referral[" ).append( i ).append( "] :" ).append(
referral )
+                        .append( '\n' );
+            }
+        }
+
+        return sb.toString();
+    }
 }



Mime
View raw message