directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1702318 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java
Date Thu, 10 Sep 2015 21:01:32 GMT
Author: elecharny
Date: Thu Sep 10 21:01:32 2015
New Revision: 1702318

URL: http://svn.apache.org/r1702318
Log:
Added the getScope(String) that returns the instance of SearchScope associated with the String
parameter

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java?rev=1702318&r1=1702317&r2=1702318&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/SearchScope.java
Thu Sep 10 21:01:32 2015
@@ -114,6 +114,32 @@ public enum SearchScope
 
 
     /**
+     * Gets the SeacrhScope associated with a scope String
+     * 
+     * @return the scope
+     */
+    public SearchScope getScope( String scope )
+    {
+        if ( "base".equalsIgnoreCase( scope ) )
+        {
+            return OBJECT;
+        }
+        else if ( "one".equalsIgnoreCase( scope ) )
+        {
+            return ONELEVEL;
+        }
+        else if ( "sub".equalsIgnoreCase( scope ) )
+        {
+            return SUBTREE;
+        }
+        else
+        {
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04161, scope ) );
+        }
+    }
+
+
+    /**
      * Gets the SearchScope enumerated type for the corresponding 
      * scope value of either base, one or sub.
      *



Mime
View raw message