directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r796627 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
Date Wed, 22 Jul 2009 08:23:24 GMT
Author: pamarcelot
Date: Wed Jul 22 08:23:23 2009
New Revision: 796627

URL: http://svn.apache.org/viewvc?rev=796627&view=rev
Log:
Rollback of commit 770594. This method was not so useless... ;)

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=796627&r1=796626&r2=796627&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
Wed Jul 22 08:23:23 2009
@@ -1217,6 +1217,35 @@
 
 
     /**
+     * Converts an {@link Entry} to an {@link Attributes}.
+     *
+     * @param entry
+     *      the {@link Entry} to convert
+     * @return
+     *      the equivalent {@link Attributes}
+     */
+    public static Attributes toAttributes( Entry entry )
+    {
+        if ( entry != null )
+        {
+            Attributes attributes = new BasicAttributes();
+
+            // Looping on attributes
+            for ( Iterator<EntryAttribute> attributeIterator = entry.iterator(); attributeIterator.hasNext();
)
+            {
+                EntryAttribute entryAttribute = ( EntryAttribute ) attributeIterator.next();
+
+                attributes.put( toAttribute( entryAttribute ) );
+            }
+
+            return attributes;
+        }
+
+        return null;
+    }
+
+
+    /**
      * Converts an {@link EntryAttribute} to an {@link Attribute}.
      *
      * @param entryAttribute



Mime
View raw message