directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r939625 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java
Date Fri, 30 Apr 2010 10:36:16 GMT
Author: kayyagari
Date: Fri Apr 30 10:36:16 2010
New Revision: 939625

URL: http://svn.apache.org/viewvc?rev=939625&view=rev
Log:
added a convenient method to get the AliasDerefMode based on a derefmode's int value

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

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java?rev=939625&r1=939624&r2=939625&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AliasDerefMode.java
Fri Apr 30 10:36:16 2010
@@ -200,6 +200,29 @@ public enum AliasDerefMode
     }
 
 
+    /**
+     * get the AliasDerefMode corresponding to the integer value passed
+     *
+     * @param val the AliasDerefMode's integer value
+     * @return the AliasDerefMode whose value is equivalent to the given integer value
+     */
+    public static AliasDerefMode getDerefMode( int val )
+    {
+        switch( val )
+        {
+            case 0: return NEVER_DEREF_ALIASES;
+            
+            case 1: return DEREF_IN_SEARCHING;
+            
+            case 2: return DEREF_FINDING_BASE_OBJ;
+            
+            case 3: return DEREF_ALWAYS;
+            
+            default: throw new IllegalArgumentException( "Unknown derefmode " + val );
+        }
+    }
+    
+    
     public String getJndiValue()
     {
         return jndiValue;



Mime
View raw message