directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1655414 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java
Date Wed, 28 Jan 2015 17:59:42 GMT
Author: elecharny
Date: Wed Jan 28 17:59:41 2015
New Revision: 1655414

URL: http://svn.apache.org/r1655414
Log:
o Added a comment in the class header
o Added the @inheritDoc tag
o added the /*no qualifier*/ comment in front of the class
o Added the missing Javadoc
o Removed the Operator which is not needed for this class

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java?rev=1655414&r1=1655413&r2=1655414&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/search/AttributeFilter.java
Wed Jan 28 17:59:41 2015
@@ -21,53 +21,43 @@ package org.apache.directory.ldap.client
 
 
 /**
- * 
- * TODO AttributeFilter.
+ * This class is used to handle the Present filter (ie, attr =* )
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-class AttributeFilter extends AbstractFilter
+/* No qualifier*/class AttributeFilter extends AbstractFilter
 {
+    /** The attribute that must be prersent */
     private String attribute;
-    private Operator operator;
 
 
-    private AttributeFilter( String attribute, Operator operator )
+    /**
+     * Creates a new instance of PresentFilter.
+     */
+    private AttributeFilter( String attribute )
     {
         this.attribute = attribute;
-        this.operator = operator;
     }
 
 
+    /**
+     * Creates a new PresentFilter 
+     *
+     * @param attribute The attribute that must be present
+     * @return The created PresenceFilter instance
+     */
     public static AttributeFilter present( String attribute )
     {
-        return new AttributeFilter( attribute, Operator.PRESENT );
+        return new AttributeFilter( attribute );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public StringBuilder build( StringBuilder builder )
     {
-        return builder.append( "(" ).append( attribute )
-            .append( operator.operator() ).append( ")" );
-    }
-
-    public static enum Operator
-    {
-        PRESENT("=*");
-
-        private String operator;
-
-
-        private Operator( String operator )
-        {
-            this.operator = operator;
-        }
-
-
-        public String operator()
-        {
-            return operator;
-        }
+        return builder.append( "(" ).append( attribute ).append( "=*)" );
     }
 }
\ No newline at end of file



Mime
View raw message