directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r675982 - in /directory/shared/branches/bigbang: ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java
Date Fri, 11 Jul 2008 15:09:14 GMT
Author: kayyagari
Date: Fri Jul 11 08:09:13 2008
New Revision: 675982

URL: http://svn.apache.org/viewvc?rev=675982&view=rev
Log:
added a static method which takes an int value and retirns the corresponding enum constant

Modified:
    directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java

Modified: directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java?rev=675982&r1=675981&r2=675982&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java
(original)
+++ directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/AuthenticationLevel.java
Fri Jul 11 08:09:13 2008
@@ -75,4 +75,20 @@
     {
         return name;
     }
+    
+    
+    public static AuthenticationLevel getLevel( int val )
+    {
+        switch( val )
+        {
+            case 0: return NONE;
+            
+            case 1: return SIMPLE;
+            
+            case 2: return STRONG;
+            
+            default:
+                throw new IllegalArgumentException( "Unknown AuthenticationLevel " + val
);
+        }
+    }
 }

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java?rev=675982&r1=675981&r2=675982&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/ChangeType.java
Fri Jul 11 08:09:13 2008
@@ -73,4 +73,23 @@
     {
         return changeType;
     }
+    
+    public static ChangeType getChangeType( int val )
+    {
+        switch( val )
+        {
+            case 0: return Add;
+            
+            case 1: return Modify;
+            
+            case 2: return ModDn;
+            
+            case 3: return ModRdn;
+            
+            case 4: return Delete;
+            
+            default:
+                throw new IllegalArgumentException( "Unknown change type value " + val );
+        }
+    }
 }



Mime
View raw message