directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r224574 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters: AndFilter.java OrFilter.java
Date Sat, 23 Jul 2005 23:00:52 GMT
Author: elecharny
Date: Sat Jul 23 16:00:48 2005
New Revision: 224574

URL: http://svn.apache.org/viewcvs?rev=224574&view=rev
Log:
Added a toString() method

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

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/AndFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/AndFilter.java?rev=224574&r1=224573&r2=224574&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/AndFilter.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/AndFilter.java
Sat Jul 23 16:00:48 2005
@@ -25,8 +25,6 @@
  */
 public class AndFilter extends ConnectorFilter
 {
-    //~ Instance fields ----------------------------------------------------------------------------
-
     //~ Methods ------------------------------------------------------------------------------------
 
     /**
@@ -46,5 +44,18 @@
     {
         return filterSet;
     }
-
+    
+    /**
+     * Return a string compliant with RFC 2254 representing an AND filter
+     *
+     * @return The AND filter string
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        
+        sb.append('&').append(super.toString());
+        
+        return sb.toString();
+    }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/OrFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/OrFilter.java?rev=224574&r1=224573&r2=224574&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/OrFilter.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/filters/OrFilter.java
Sat Jul 23 16:00:48 2005
@@ -26,9 +26,7 @@
  */
 public class OrFilter extends ConnectorFilter
 {
-    //~ Instance fields ----------------------------------------------------------------------------
-
-    //~ Methods ------------------------------------------------------------------------------------
+    //~ Constructors -------------------------------------------------------------------------------
 
     /**
      * The constructor. We wont initialize the ArrayList as they may not be used. 
@@ -36,7 +34,9 @@
     public OrFilter()
     {
     }
-    
+
+    //~ Methods ------------------------------------------------------------------------------------
+
     /**
      * Get the OrFilter
      *
@@ -45,5 +45,20 @@
     public ArrayList getOrFilter()
     {
         return filterSet;
+    }
+
+    /**
+     * Return a string compliant with RFC 2254 representing an OR filter
+     *
+     * @return The OR filter string
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( '|' ).append( super.toString() );
+
+        return sb.toString();
     }
 }



Mime
View raw message