directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r871864 - in /websites/staging/directory/trunk/content: ./ api/user-guide/6.12-entry.html
Date Tue, 30 Jul 2013 14:53:26 GMT
Author: buildbot
Date: Tue Jul 30 14:53:26 2013
New Revision: 871864

Log:
Staging update by buildbot for directory

Modified:
    websites/staging/directory/trunk/content/   (props changed)
    websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html

Propchange: websites/staging/directory/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Jul 30 14:53:26 2013
@@ -1 +1 @@
-1508245
+1508477

Modified: websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html
==============================================================================
--- websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html (original)
+++ websites/staging/directory/trunk/content/api/user-guide/6.12-entry.html Tue Jul 30 14:53:26 2013
@@ -141,151 +141,113 @@
 <p>The <em>Entry</em> class is one of the most important one in the <em>API</em>. It describes the base element stored into a <em>LDAP</em> server, and it associates a <em>Dn</em> and some <em>Attributes</em>.</p>
 <p>We have two kinds of <em>Entry</em> in the <em>API</em>, depending on the presence of a <em>SchemaManager</em> in the <em>Entry</em>, or not.</p>
 <p>We also provide a few extended classes, like the <em>ImmutableEntry</em>, an immutable version of the <em>Entry</em>.</p>
+<h2 id="what-is-an-entry">What is an entry ?</h2>
+<p>An entry is an object containing a <em>Dn</em> and some <em>Attributes</em>. The following schema shows what's inside an <em>entry</em> :</p>
+<p><img alt="" src="../../images/entry.png" /></p>
 <h2 id="creating-an-entry">Creating an Entry</h2>
 <p>We have many ways to create an <em>Entry</em>. Basically, an <em>Entry</em> has a <em>Dn</em> and some <em>Attributes</em>. It can be schema aware, or not. We provide constructors to allow a user to create the kind of <em>Entry</em> he wants.</p>
-<p>The simplest way to create an <em>Entry</em> is to call the default constructor. The created entry will have no attributes, and no Dn. We can also make it schema aware by passing a <em>SchemaManager</em>. Here is an example:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEmptyEntry</span><span class="o">()</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">();</span>
+<p>The simplest way to create an <em>Entry</em> is to call the default constructor. The created entry will have no attributes, and no <em>Dn</em>. We can also make it schema aware by passing a <em>SchemaManager</em>. Here is an example:</p>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">();</span>
 
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">Dn</span><span class="o">.</span><span class="na">EMPTY_DN</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
-
-    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">);</span>
-
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">Dn</span><span class="o">.</span><span class="na">EMPTY_DN</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="c1">// Now set the DN and some attributes</span>
+<span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">();</span>
+
+<span class="n">entry</span><span class="o">.</span><span class="na">setDn</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+<span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;dc&quot;</span><span class="o">,</span> <span class="s">&quot;example&quot;</span> <span class="o">);</span>
+
+<span class="c1">// Schema aware entry</span>
+<span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">);</span>
+
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;dc&quot;</span><span class="o">,</span> <span class="s">&quot;example&quot;</span> <span class="o">);</span>
 </pre></div>
 
 
 <p>You can also create an <em>Entry</em> passing a <em>Dn</em>, but no attribute. We can create schema aware entries this way too, passing a <em>SchemaManager</em>.</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryWithDn</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Dn</span> <span class="n">dn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Dn</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;DomainComponent=example, dc=COM&quot;</span> <span class="o">);</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">Dn</span> <span class="n">dn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Dn</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;DomainComponent=example, dc=COM&quot;</span> <span class="o">);</span>
+<span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
-
-    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
-
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">dn</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="mi">0</span><span class="o">,</span> <span class="n">entry2</span><span class="o">.</span><span class="na">size</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">isSchemaAware</span><span class="o">()</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;dc&quot;</span><span class="o">,</span> <span class="s">&quot;example&quot;</span> <span class="o">);</span>
+
+<span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
+
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;dc&quot;</span><span class="o">,</span> <span class="s">&quot;example&quot;</span> <span class="o">);</span>
+<span class="o">...</span>
 </pre></div>
 
 
 <p>We can also create an entry by copying an existing entry. The created <em>Entry</em> must be schema aware. Here is an example:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryCopy</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
-    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
-    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atSn</span><span class="o">,</span> <span class="s">&quot;Test&quot;</span> <span class="o">);</span>
-    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="s">&quot;dc=example, dc=com&quot;</span> <span class="o">);</span>
 
-    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="n">entry</span> <span class="o">);</span>
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<span class="n">entry2</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;dc&quot;</span><span class="o">,</span> <span class="s">&quot;example&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">(),</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+<span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="n">schemaManager</span><span class="o">,</span> <span class="n">entry</span> <span class="o">);</span>
 
-    <span class="n">entry</span><span class="o">.</span><span class="na">clear</span><span class="o">();</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;TEST&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atSn</span><span class="o">,</span> <span class="s">&quot;TEST&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry2</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="n">assertEquals</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">(),</span> <span class="n">entry2</span><span class="o">.</span><span class="na">getDn</span><span class="o">()</span> <span class="o">);</span>
+
+<span class="n">entry</span><span class="o">.</span><span class="na">clear</span><span class="o">();</span>
 </pre></div>
 
 
 <p>Last, not least, it's possible to create an <em>Entry</em> using a list of LDIF formated attributes. An example worth ten lines of documentation, so let's see what it means.</p>
 <p>First, we will create a schema agnostic entry:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdif</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span>
-        <span class="o">);</span>
-
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: domain&quot;</span><span class="o">,</span>
+    <span class="s">&quot;dc: example&quot;</span>
+    <span class="o">);</span>
 </pre></div>
 
 
 <p>We can also provide a complete LDIF file (except that we can't add the <em>dn</em>):</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdifComplete</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
-<span class="o">{</span>
-    <span class="n">String</span> <span class="n">ldif</span> <span class="o">=</span>
-        <span class="s">&quot;objectClass: top\n&quot;</span> <span class="o">+</span>           <span class="c1">// The \n is mandatory.</span>
-        <span class="s">&quot;objectClass: person\n&quot;</span> <span class="o">+</span>
-        <span class="s">&quot;cn: test\n&quot;</span> <span class="o">+</span>
-        <span class="s">&quot;sn: test&quot;</span><span class="o">;</span>
-
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">ldif</span> <span class="o">);</span>
-
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">ldif</span> <span class="o">=</span>
+    <span class="s">&quot;objectClass: top\n&quot;</span> <span class="o">+</span>           <span class="c1">// The \n is mandatory.</span>
+    <span class="s">&quot;objectClass: domain\n&quot;</span> <span class="o">+</span>
+    <span class="s">&quot;dc: example&quot;</span><span class="o">;</span>
+
+<span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">ldif</span> <span class="o">);</span>
 </pre></div>
 
 
 <p>One can also combine LDIF and variables like in this example (note that if you use a variable, the attribute must not be followed by the <em>':'</em> char):</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testCreateEntryLdif2</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">Exception</span>
-<span class="o">{</span>
-    <span class="n">String</span> <span class="n">name</span> <span class="o">=</span> <span class="s">&quot;test&quot;</span><span class="o">;</span>
-    <span class="n">String</span> <span class="n">surname</span> <span class="o">=</span> <span class="s">&quot;test&quot;</span><span class="o">;</span>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">domain</span> <span class="o">=</span> <span class="s">&quot;example&quot;</span><span class="o">;</span>
 
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="n">name</span><span class="o">,</span>             <span class="c1">// No &#39;:&#39;</span>
-        <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="n">surname</span>
-        <span class="o">);</span>
-
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span> <span class="n">entry</span><span class="o">.</span><span class="na">getDn</span><span class="o">().</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;objectClass&quot;</span><span class="o">,</span> <span class="s">&quot;top&quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: domain&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cc&quot;</span><span class="o">,</span> <span class="n">domain</span>             <span class="c1">// No &#39;:&#39;</span>
+    <span class="o">);</span>
+</pre></div>
+
+
+<p>All in all, the following constructors are available :</p>
+<div class="codehilite"><pre><span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">()</span> <span class="p">:</span> <span class="n">Default</span> <span class="n">constructor</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">)</span> <span class="p">:</span> <span class="n">Default</span> <span class="n">constructor</span> <span class="k">for</span> <span class="n">a</span> <span class="n">schema</span> <span class="n">aware</span> <span class="n">entry</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">an</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">as</span> <span class="n">a</span> <span class="n">String</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">,</span> <span class="n">String</span><span class="p">)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">a</span> <span class="n">schema</span> <span class="n">aware</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">as</span> <span class="n">a</span> <span class="n">String</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">Dn</span><span class="p">)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">an</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">,</span> <span class="n">Dn</span><span class="p">)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">a</span> <span class="n">schema</span> <span class="n">aware</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">as</span> <span class="n">a</span> <span class="n">String</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">Dn</span><span class="p">,</span> <span class="n">Object</span><span class="p">...)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">an</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">and</span> <span class="n">some</span> <span class="n">attributes</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Object</span><span class="p">...)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">a</span> <span class="n">schema</span> <span class="n">aware</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">as</span> <span class="n">a</span> <span class="n">String</span><span class="p">,</span> <span class="n">and</span> <span class="n">some</span> <span class="n">attributes</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">,</span> <span class="n">Dn</span><span class="p">,</span> <span class="n">Object</span><span class="p">...)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">a</span> <span class="n">schema</span> <span class="n">aware</span> <span class="n">entry</span> <span class="n">with</span> <span class="n">a</span> <span class="n">DN</span> <span class="n">and</span> <span class="n">some</span> <span class="n">attributes</span>
+<span class="o">*</span> <span class="n">DefaultEntry</span><span class="p">(</span><span class="n">SchemaManager</span><span class="p">,</span> <span class="n">Entry</span><span class="p">)</span> <span class="p">:</span> <span class="n">Creates</span> <span class="n">an</span> <span class="n">entry</span> <span class="n">using</span> <span class="n">a</span> <span class="n">copy</span> <span class="n">of</span> <span class="n">another</span> <span class="n">entry</span>
 </pre></div>
 
 
 <h2 id="modifying-an-entry">Modifying an Entry</h2>
-<p>We have four methods available that modify the <em>Entry</em> content : <em>add</em>, <em>remove</em>, <em>put</em> and <em>set</em>. We will review those four methods in the following paragraphs.</p>
+<p>We have six methods available that modify the <em>Entry</em> content : <em>add</em>, <em>clear</em>, <em>put</em>, <em>remove</em>, <em>removeAttribute</em> and <em>setDn</em>. We will review six four methods in the following paragraphs.</p>
 <h3 id="adding-attributes">Adding Attributes</h3>
-<p>Two methods can be used to add some attribute into an <em>Entry</em>, depending on the fact that we will add some value without replacing an existing attribute with the same name (and we use the <em>add</em> method for that), or replace it with a new attribute (and we use the <em>put</em> method for that).</p>
+<p>Two methods can be used to add some attribute into an <em>Entry</em>. The first one will add a complete <em>Attribute</em>, the second one will add some values to an existing <em>Attribute</em>.</p>
 <p>In any case, we can add either an empty attribute, or an attribute with some values. Those values can be <em>Strings</em>, <em>byte[]</em> or <em>Values</em>. The added attributes can be schema aware, and we can also provide a user provided name for the attribute type.</p>
 <h5 id="add-methods">add() methods</h5>
 <p>The first method makes it possible to add some existing <em>Attribute</em> to an <em>Entry</em>. Let's see how it works:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryAddAttribute</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Attribute</span> <span class="n">cn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre>    <span class="n">Attribute</span> <span class="n">cn</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
     <span class="n">Attribute</span> <span class="n">cn2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">);</span>
 
     <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
@@ -294,119 +256,75 @@
         <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
         <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Add the new attribute</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">cn</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Try to add a second value</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">cn2</span> <span class="o">);</span>
-
-    <span class="c1">// Both values must be present</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
 </pre></div>
 
 
 <p>Otherwise, we can add a new attribute and values into the <em>Entry</em> by passing both parameters. We can also pass an <em>AttributeType</em> to the <em>add()</em> method, making the added attribute schema aware. Note that if the <em>Entry</em> itself is already schema aware, this is not necessary.</p>
 <p>Here are some examples, the first one with a schema aware <em>Entry</em>, the second one with a schema agnostic <em>Entry</em>:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryAddAtValue</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+<p>For a schema aware entry :</p>
+<div class="codehilite"><pre>    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="n">schemaManager</span><span class="o">,</span>
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
         <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Add the new attribute</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;CN&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Try to add a second value</span>
-    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;A  second test   &quot;</span> <span class="o">);</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;A  second test   &quot;</span> <span class="o">);</span>
 
-    <span class="c1">// Both values must be present</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span><span class="o">,</span> <span class="s">&quot;a second test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
-</pre></div>
+    <span class="c1">// We can also add a value to an existing Attribute </span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;sn&quot;</span><span class="o">,</span> <span class="s">&quot;Another SN&quot;</span> <span class="o">);</span>
 
+    <span class="c1">// And even add many values in one shot</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;value1&quot;</span><span class="o">,</span> <span class="s">&quot;value2&quot;</span> <span class="o">);</span>
+</pre></div>
 
-<DIV class="note" markdown="1">
-*Warning !*
-When manipulating a schema agnostic *Entry*, do not expect that the attribute type will be recognized if you inject schema aware attributes.
-</DIV>
 
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryAddAtValue</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+<p>For a schema agnostic entry :</p>
+<div class="codehilite"><pre>    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
         <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Add the new attribute</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Try to add a second value</span>
-    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="n">atCn</span><span class="o">,</span> <span class="s">&quot;A  second  test&quot;</span> <span class="o">);</span>
-
-    <span class="c1">// Both values must be present</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;2.5.4.3&quot;</span><span class="o">,</span> <span class="s">&quot;a second test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;A  second  test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">add</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;A  second  test&quot;</span> <span class="o">);</span>
 </pre></div>
 
 
+<p>As you can see, there is no real difference between those two methods, except that we pass the <em>schemaManager</em> in the first one.</p>
 <h5 id="put-methods">put() methods</h5>
 <p>The big difference with the <em>add</em> method is that the attribute is not added, it will replace an existing one. let's see with an example :</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryPutAttribute</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+<div class="codehilite"><pre>    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="n">schemaManager</span><span class="o">,</span> 
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
         <span class="s">&quot;sn: test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Add the new attribute</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">put</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
-    <span class="c1">// Try to add a second value</span>
+    <span class="c1">// Try to add a second value : the &#39;cn&#39; attribute will now contain only &#39;test2&#39;</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">put</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">);</span>
-
-    <span class="c1">// Both values must be present</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
 </pre></div>
 
 
 <h3 id="removing-attributes">Removing Attributes</h3>
 <p>We can remove either an attribute having a specific value, or an entire attribute. In order to remove a complete attribute, you just have to provide the attribute's name, and use the <em>removeAttributes</em> method.</p>
 <p>Here are some example for both usages :</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testRemoveAttribute</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+<div class="codehilite"><pre>    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="n">schemaManager</span><span class="o">,</span>
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
@@ -416,33 +334,19 @@ When manipulating a schema agnostic *Ent
         <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
         <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test1&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span><span class="o">,</span> <span class="s">&quot;test3&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Remove the &quot;test2&quot; value</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">remove</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test1&quot;</span><span class="o">,</span> <span class="s">&quot;test3&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
     <span class="c1">// Try to remove the full attribute</span>
     <span class="n">entry</span><span class="o">.</span><span class="na">removeAttributes</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">);</span>
-
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
 </pre></div>
 
 
-<h4 id="storing-a-dn">Storing a Dn</h4>
-<p>It's also possible to store a new <em>Dn</em> into the Entry, using the <em>setDn() method. It will replace an existing _Dn</em> This method takes either a <em>Dn</em> instance, or a <em>String</em>.</p>
-<h2 id="attribute-data-access-methods">Attribute data access methods</h2>
-<p>The <em>API</em> provides convenient methods to access the <em>Entry</em> content, and to check if it contains some attributes or some values. We will shortly expose those methods in the following paragraphs.</p>
-<h3 id="contains-method">Contains method</h3>
-<p>The <em>contains</em> and <em>containsAttributes</em> methods check that the <em>Entry</em> contain a couple of <attributeType/values> for the first set of methods, and for the existence of a specific attribute for the second method.</p>
-<p>One can check for the existence of a specific value for a given attribute, or even for multiple values for a specific attribute. Let's see the <em>contains</em> method in action:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testContains</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+<h3 id="storing-a-dn">Storing a Dn</h3>
+<p>It's also possible to store a new <em>Dn</em> into the Entry, using the <em>setDn() method. It will replace an existing _Dn</em> This method takes either a <em>Dn</em> instance, or a <em>String</em> representing a valid <em>Dn</em>.</p>
+<h3 id="clearing-the-entry">Clearing the Entry</h3>
+<p>You can remove all the <em>Attribute</em> from the entry, using the <em>clear()</em> method :</p>
+<div class="codehilite"><pre>    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="n">schemaManager</span><span class="o">,</span>
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
         <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
@@ -452,21 +356,39 @@ When manipulating a schema agnostic *Ent
         <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
         <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;sn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test1&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span><span class="o">,</span> <span class="s">&quot;test3&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test1&quot;</span> <span class="o">)</span> <span class="o">);</span>
+    <span class="c1">// Remove all the attributes</span>
+    <span class="n">entry</span><span class="o">.</span><span class="na">clear</span><span class="o">();</span>
+</pre></div>
 
-    <span class="c1">// The value does not exist for the &quot;cn&quot; attribute</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test4&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+
+<p>The <em>Dn</em> will still be around though.</p>
+<h2 id="attribute-data-access-methods">Attribute data access methods</h2>
+<p>The <em>API</em> provides convenient methods to access the <em>Entry</em> content, and to check if it contains some attributes or some values. We will shortly expose those methods in the following paragraphs.</p>
+<h3 id="contains-method">Contains method</h3>
+<p>The <em>contains</em> and <em>containsAttributes</em> methods check that the <em>Entry</em> contains <em>Attributes</em> and <em>values</em>.</p>
+<p>One can check for the existence of a specific value for a given attribute, or even for multiple values for a specific attribute. Let's see the <em>contains</em> method in action:</p>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="n">schemaManager</span><span class="o">,</span>
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test1&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
+
+<span class="c1">// Check that the entry contains the &#39;cn&#39; and &#39;sn&#39; Attributes</span>
+<span class="kt">boolean</span> <span class="n">contains</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">containsAttribute</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;sn&quot;</span> <span class="o">);</span>
+
+<span class="c1">// Check that the entry contains 3 given values of the &#39;cn&#39; Attribute</span>
+<span class="n">contains</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span><span class="o">,</span> <span class="s">&quot;test1&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span><span class="o">,</span> <span class="s">&quot;test3&quot;</span> <span class="o">)</span> <span class="o">);</span>
 </pre></div>
 
 
-<h4 id="getattributetype-and-getstring">get(AttributeType) and get(String)</h4>
+<p>Note that if one value does not exist, the _contains() method will return false.</p>
+<h3 id="getattributes-and-get-methods">getAttributes() and get() methods</h3>
 <p>Returns the <em>Attribute</em> having the given name if it exists. The following test demonstrates its usage:</p>
 <div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testGet</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
     <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
         <span class="n">schemaManager</span><span class="o">,</span>
         <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
@@ -477,108 +399,54 @@ When manipulating a schema agnostic *Ent
         <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
         <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
 
-    <span class="c1">// With an attribute&#39;s name</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">).</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;test1&quot;</span><span class="o">,</span> <span class="s">&quot;test2&quot;</span><span class="o">,</span> <span class="s">&quot;test3&quot;</span> <span class="o">)</span> <span class="o">);</span>
-
-    <span class="c1">// With an AttributeType</span>
-    <span class="n">assertNotNull</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span> <span class="n">atSn</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span> <span class="n">atSn</span> <span class="o">).</span><span class="na">contains</span><span class="o">(</span> <span class="s">&quot;test&quot;</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
-</pre></div>
-
+    <span class="c1">// Get the &#39;cn&#39; Attribute</span>
+    <span class="n">Attribute</span> <span class="n">cn</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span> <span class="s">&quot;cn&quot;</span> <span class="o">)</span> <span class="o">);</span>
 
-<h4 id="getattributetypes">getAttributeTypes()</h4>
-<p>This method returns the list of <em>AttributeTypes</em> stored into the <em>Entry</em>.</p>
-<p>{note:title=Be careful !}
-This method is only valuable if the <em>Entry</em> is schema aware !
-{note}</p>
-<p>Here is an example of usage:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testGetAttributeTypes</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="n">schemaManager</span><span class="o">,</span>
-        <span class="s">&quot;cn=example, dc=com&quot;</span><span class="o">,</span> 
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: example&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span>
-        <span class="o">);</span>
-
-    <span class="k">for</span> <span class="o">(</span> <span class="n">AttributeType</span> <span class="n">attr</span> <span class="o">:</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributeTypes</span><span class="o">()</span> <span class="o">)</span>
-    <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span> <span class="n">attr</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">);</span>
-    <span class="o">}</span>
-<span class="o">}</span>
-</pre></div>
-
-
-<p>This code produces the following output:</p>
-<div class="codehilite"><pre><span class="n">sn</span>
-<span class="n">objectClass</span>
-<span class="n">cn</span>
+    <span class="c1">// Get all the Attributes</span>
+    <span class="n">Collection</span><span class="o">&lt;</span><span class="n">Attribute</span><span class="o">&gt;</span> <span class="n">attributes</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">getAttributes</span><span class="o">();</span>
 </pre></div>
 
 
-<h4 id="getdn">getDn()</h4>
+<h3 id="getdn">getDn()</h3>
 <p>This method returns the <em>Entry</em>'s <em>Dn</em>.</p>
-<h4 id="hasobjectclass-methods">hasObjectClass methods</h4>
+<h3 id="hasobjectclass-methods">hasObjectClass methods</h3>
 <p>The <em>hasObjectClass()</em> methods are used to discover if an <em>Entry</em> has a specific <em>ObjectClass</em>. This is a convenient method, as it's possible to do the same thing with a <em>contains()</em> call, but with one less parameter (you don't have to provide the <em>"ObjectClass"</em> as a first parameter).</p>
 <p>Here is an example using the two existing methods:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testHasObjectClass</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="n">schemaManager</span><span class="o">,</span>
-        <span class="s">&quot;cn=example, dc=com&quot;</span><span class="o">,</span> 
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: example&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span>
-        <span class="o">);</span>
-
-    <span class="c1">// Test the presence</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="s">&quot;person&quot;</span><span class="o">,</span> <span class="s">&quot; TOP &quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="s">&quot;domain &quot;</span><span class="o">,</span> <span class="s">&quot;TOP&quot;</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="s">&quot;Person &quot;</span> <span class="o">)</span> <span class="o">);</span>
-
-    <span class="c1">// Same test, but with Attributes</span>
-    <span class="n">Attribute</span> <span class="n">oc1</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;TOP &quot;</span><span class="o">,</span> <span class="s">&quot;person&quot;</span> <span class="o">);</span>
-    <span class="n">Attribute</span> <span class="n">oc2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;person &quot;</span> <span class="o">);</span>
-    <span class="n">Attribute</span> <span class="n">oc3</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultAttribute</span><span class="o">(</span> <span class="n">atObjectClass</span><span class="o">,</span> <span class="s">&quot;TOP&quot;</span><span class="o">,</span> <span class="s">&quot;domain&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="n">schemaManager</span><span class="o">,</span>
+    <span class="s">&quot;cn=example, dc=com&quot;</span><span class="o">,</span> 
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: example&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span>
+    <span class="o">);</span>
 
-    <span class="n">assertTrue</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="n">oc1</span><span class="o">,</span> <span class="n">oc2</span> <span class="o">)</span> <span class="o">);</span>
-    <span class="n">assertFalse</span><span class="o">(</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="n">oc1</span><span class="o">,</span> <span class="n">oc3</span> <span class="o">)</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="c1">// Test the presence</span>
+<span class="kt">boolean</span> <span class="n">isPresent</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">hasObjectClass</span><span class="o">(</span> <span class="s">&quot;person&quot;</span><span class="o">,</span> <span class="s">&quot; TOP &quot;</span> <span class="o">);</span>
 </pre></div>
 
 
+<p>As for the <em>contains()</em> method, it will return true if and only if all the ObjectClasses are present in the <em>entry</em>.</p>
 <p>Obviously, dealing with a schema agnostic <em>Entry</em>, those methods are more strict. You have to use the exact ObjectClasses case sensitive trimmed names (in the previous example, we can use upper cased names, even with spaces around the names).</p>
 <p>Also note that the <em>hasObjectClass</em> method used with <em>AttributeType</em> does not work on a schema agnostic entry.</p>
 <h2 id="miscellaneous-methods">Miscellaneous methods</h2>
 <p>We also have some other methods which can be used on an <em>Entry</em>. Here is a list of those methods.</p>
-<h4 id="clear">clear()</h4>
-<p>This method removes all the added <em>Attributes</em> from this <em>Entry</em>. The <em>Dn</em> remains the same.</p>
 <h4 id="clone">clone()</h4>
 <p>Creates a copy of the current <em>Entry</em>. All the <em>Attributes</em> are also cloned.</p>
 <h4 id="iterator">iterator()</h4>
 <p>Allows an iteration over all the <em>Attributes</em>. The following examples shows how this can be used:</p>
 <div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testIterator</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
+<span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="s">&quot;cn=example, dc=com&quot;</span><span class="o">,</span> 
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: example&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span>
+    <span class="o">);</span>
+
+<span class="k">for</span> <span class="o">(</span> <span class="n">Attribute</span> <span class="n">attribute</span> <span class="o">:</span> <span class="n">entry</span> <span class="o">)</span>
 <span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="s">&quot;cn=example, dc=com&quot;</span><span class="o">,</span> 
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: example&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span>
-        <span class="o">);</span>
-
-    <span class="k">for</span> <span class="o">(</span> <span class="n">Attribute</span> <span class="n">attribute</span> <span class="o">:</span> <span class="n">entry</span> <span class="o">)</span>
-    <span class="o">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span> <span class="s">&quot;Attribute : \n&quot;</span> <span class="o">+</span> <span class="n">attribute</span><span class="o">.</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
-    <span class="o">}</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span> <span class="s">&quot;Attribute : \n&quot;</span> <span class="o">+</span> <span class="n">attribute</span><span class="o">.</span><span class="na">toString</span><span class="o">()</span> <span class="o">);</span>
 <span class="o">}</span>
 </pre></div>
 
@@ -605,58 +473,52 @@ This method is only valuable if the <em>
 <p>Check if two <em>Entries</em> are equal or not. It's important to understand that depending on whether the entry is schema aware or not, the comparison will be processed differently. Typically, the attribute's name must be equals when they have been trimmed and lower cased if the entry is not schema aware, and we can't compare an attribute named 'cn' with another one named '2.5.4.3' in this case (the <em>Entry</em> must be schema aware to allow such comparison). More important, the values <em>must</em> be identical (same casing, same spaces) in this case.
 The attribute's values order is irrelevant.</p>
 <p>Here are one example with a schema agnostic <em>Entry</em>:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testEntryEquals</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test1&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
-
-    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
-        <span class="s">&quot;CN: test1&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test1&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
+
+<span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
+    <span class="s">&quot;CN: test1&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
 
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">entry</span><span class="o">,</span> <span class="n">entry2</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="c1">// Will return true</span>
+<span class="kt">boolean</span> <span class="n">result</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span> <span class="n">entry2</span> <span class="o">);</span>
 </pre></div>
 
 
 <p>and another example with a schema aware <em>Entry</em>:</p>
-<div class="codehilite"><pre><span class="nd">@Test</span>
-<span class="kd">public</span> <span class="kt">void</span> <span class="nf">testSchemaAwayeEntryEquals</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">LdapException</span>
-<span class="o">{</span>
-    <span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="n">schemaManager</span><span class="o">,</span>
-        <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test1&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
+<div class="codehilite"><pre><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="n">schemaManager</span><span class="o">,</span>
+    <span class="s">&quot;dc=example, dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: top&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: test&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test1&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test2&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: test3&quot;</span> <span class="o">);</span>
+
+<span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
+    <span class="n">schemaManager</span><span class="o">,</span>
+    <span class="s">&quot;dc=example,dc=com&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: TOP&quot;</span><span class="o">,</span>
+    <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
+    <span class="s">&quot;sn: Test&quot;</span><span class="o">,</span>
+    <span class="s">&quot;cn: Test2&quot;</span><span class="o">,</span>
+    <span class="s">&quot;2.5.4.3: test1&quot;</span><span class="o">,</span>
+    <span class="s">&quot;CommonName: test3&quot;</span> <span class="o">);</span>
 
-    <span class="n">Entry</span> <span class="n">entry2</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultEntry</span><span class="o">(</span> 
-        <span class="n">schemaManager</span><span class="o">,</span>
-        <span class="s">&quot;dc=example,dc=com&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: TOP&quot;</span><span class="o">,</span>
-        <span class="s">&quot;objectClass: person&quot;</span><span class="o">,</span>
-        <span class="s">&quot;sn: Test&quot;</span><span class="o">,</span>
-        <span class="s">&quot;cn: Test2&quot;</span><span class="o">,</span>
-        <span class="s">&quot;2.5.4.3: test1&quot;</span><span class="o">,</span>
-        <span class="s">&quot;CommonName: test3&quot;</span> <span class="o">);</span>
-
-    <span class="n">assertEquals</span><span class="o">(</span> <span class="n">entry</span><span class="o">,</span> <span class="n">entry2</span> <span class="o">);</span>
-<span class="o">}</span>
+<span class="c1">// Will return true</span>
+<span class="kt">boolean</span> <span class="n">result</span> <span class="o">=</span> <span class="n">entry</span><span class="o">.</span><span class="na">equals</span><span class="o">(</span> <span class="n">entry2</span> <span class="o">);</span>
 </pre></div>
 
 



Mime
View raw message