directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lucasthei...@apache.org
Subject svn commit: r1656008 - /directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext
Date Fri, 30 Jan 2015 13:13:44 GMT
Author: lucastheisen
Date: Fri Jan 30 13:13:44 2015
New Revision: 1656008

URL: http://svn.apache.org/r1656008
Log:
DIRAPI-165: removed unnecessary FilterBuilder.custom

Modified:
    directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext

Modified: directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext
URL: http://svn.apache.org/viewvc/directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext?rev=1656008&r1=1656007&r2=1656008&view=diff
==============================================================================
--- directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext (original)
+++ directory/site/trunk/content/api/user-guide/2.11-filter-builder.mdtext Fri Jan 30 13:13:44
2015
@@ -220,52 +220,3 @@ Note that if we have only two strings in
     substring( "sn", "The", "ion" )).toString()
  
 would result in the string: _(sn=The*ion)_
-
-## Custom Filter
-
-Returns a new FilterBuilder from the supplied Filter.  This can be used to create your own
composite filters.  First you must create a class which implements Filter:
-
-    public class MuppetFilter implements Filter
-    {
-        private static final String filter = and(
-                equal( "objectClass", "inetOrgPerson" ),
-                equal( "departmentNumber", "muppets" ) ).toString();
-
-        private MuppetFilter()
-        {
-        }
-
-
-        public static Filter muppet()
-        {
-            return new MuppetFilter();
-        }
-
-
-        public StringBuilder build()
-        {
-            return build( new StringBuilder() );
-        }
-
-
-        public StringBuilder build( StringBuilder builder )
-        {
-            return builder.append( filter );
-        }
-    }
-
-Then you can make use of it:
-
-    custom( muppet() ).toString()
- 
-would result in the string: _(&(objectClass=inetOrgPerson)(departmentNumber=muppets))_
- 
-Which would match any inetOrgPerson with a departmentNumber of muppets.
-    
-    and( custom( muppet() ), equal( "cn", "Kermit The Frog" ) );
- 
-would result in the string: _(&(&(objectClass=inetOrgPerson)(departmentNumber=muppets)(cn=Kermit
The Frog))_
- 
-Which would match any inetOrgPerson with a departmentNumber of muppets whose common name
is Kermit The Frog.
-
-



Mime
View raw message