directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r224575 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java
Date Sat, 23 Jul 2005 23:01:57 GMT
Author: elecharny
Date: Sat Jul 23 16:01:54 2005
New Revision: 224575

URL: http://svn.apache.org/viewcvs?rev=224575&view=rev
Log:
- Added a toString() method
- changed the attribute description type from MutableString to LdapString

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java?rev=224575&r1=224574&r2=224575&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/PresentFilter.java
Sat Jul 23 16:01:54 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.asn1.ldap.pojo.filters;
 
+import org.apache.asn1.ldap.codec.primitives.LdapString;
 import org.apache.asn1.util.MutableString;
 
 
@@ -27,10 +28,11 @@
 public class PresentFilter extends Filter
 {
     //~ Instance fields ----------------------------------------------------------------------------
+
     /** The attribute description. */
-    private MutableString attributeDescription;
+    private LdapString attributeDescription;
 
-    //~ Methods ------------------------------------------------------------------------------------
+    //~ Constructors -------------------------------------------------------------------------------
 
     /**
      * The constructor. 
@@ -38,7 +40,9 @@
     public PresentFilter()
     {
     }
-    
+
+    //~ Methods ------------------------------------------------------------------------------------
+
     /**
      * Get the attribute
      *
@@ -52,10 +56,25 @@
     /**
      * Set the attributeDescription
      *
-     * @param assertion The attributeDescription to set.
+     * @param attributeDescription The attributeDescription to set.
      */
-    public void setAttributeDescription( MutableString attributeDescription )
+    public void setAttributeDescription( LdapString attributeDescription )
     {
         this.attributeDescription = attributeDescription;
+    }
+
+    /**
+     * Return a string compliant with RFC 2254 representing a Present filter
+     *
+     * @return The Present filter string
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( attributeDescription.toString() ).append( "=*" );
+
+        return sb.toString();
     }
 }



Mime
View raw message