directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1088535 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/message/AliasDerefMode.java
Date Mon, 04 Apr 2011 10:04:48 GMT
Author: kayyagari
Date: Mon Apr  4 10:04:48 2011
New Revision: 1088535

URL: http://svn.apache.org/viewvc?rev=1088535&view=rev
Log:
overloaded getDerefMode method with string value as parameter

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

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/message/AliasDerefMode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/message/AliasDerefMode.java?rev=1088535&r1=1088534&r2=1088535&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/message/AliasDerefMode.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/message/AliasDerefMode.java
Mon Apr  4 10:04:48 2011
@@ -228,6 +228,38 @@ public enum AliasDerefMode
     }
 
 
+    /**
+     * get the AliasDerefMode corresponding to the string value {@link  #jndiValue} passed
+     *
+     * @param val the AliasDerefMode's string value
+     * @return the AliasDerefMode whose value is equivalent to the given string value
+     */
+    public static AliasDerefMode getDerefMode( String val )
+    {
+        if ( val.equals( NEVER_DEREF_ALIASES.jndiValue ) )
+        {
+            return NEVER_DEREF_ALIASES;
+        }
+
+        if ( val.equals( DEREF_IN_SEARCHING.jndiValue ) )
+        {
+            return DEREF_IN_SEARCHING;
+        }
+
+        if ( val.equals( DEREF_FINDING_BASE_OBJ.jndiValue ) )
+        {
+            return DEREF_FINDING_BASE_OBJ;
+        }
+
+        if ( val.equals( DEREF_ALWAYS.jndiValue ) )
+        {
+            return DEREF_ALWAYS;
+        }
+
+        throw new IllegalArgumentException( "Unknown derefmode " + val );
+    }
+
+
     public String getJndiValue()
     {
         return jndiValue;



Mime
View raw message