directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1691227 - /directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/
Date Wed, 15 Jul 2015 14:25:12 GMT
Author: elecharny
Date: Wed Jul 15 14:25:11 2015
New Revision: 1691227

URL: http://svn.apache.org/r1691227
Log:
Some refactoring on the existing enums :
- added the getNames method in all of them
- renamed an enum

Added:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperationEnum.java
      - copied, changed from r1689488, directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperation.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/OverlayTypeEnum.java
Removed:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperation.java
Modified:
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AuthzPolicyEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DisallowFeatureEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecStyleEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecTypeEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LimitSelectorEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogLevelEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SaslSecPropEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfFeatureEnum.java
    directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfStrengthEnum.java

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AllowFeatureEnum.java
Wed Jul 15 14:25:11 2015
@@ -71,7 +71,7 @@ public enum AllowFeatureEnum
     
         for ( AllowFeatureEnum allowFeature : values() )
         {
-            names[pos] = allowFeature.getName();
+            names[pos] = allowFeature.name;
             pos++;
         }
         

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AuthzPolicyEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AuthzPolicyEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AuthzPolicyEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/AuthzPolicyEnum.java
Wed Jul 15 14:25:11 2015
@@ -84,7 +84,7 @@ public enum AuthzPolicyEnum
     
         for ( AuthzPolicyEnum authzPolicy : values() )
         {
-            names[pos] = authzPolicy.getName();
+            names[pos] = authzPolicy.name;
             pos++;
         }
         

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DbIndexTypeEnum.java
Wed Jul 15 14:25:11 2015
@@ -80,6 +80,24 @@ public enum DbIndexTypeEnum
 
     
     /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( DbIndexTypeEnum dbIndexType : values() )
+        {
+            names[pos] = dbIndexType.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
+    
+    /**
      * @return the number
      */
     public int getNumber()

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DisallowFeatureEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DisallowFeatureEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DisallowFeatureEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DisallowFeatureEnum.java
Wed Jul 15 14:25:11 2015
@@ -64,6 +64,24 @@ public enum DisallowFeatureEnum
 
     
     /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( DisallowFeatureEnum disallowFeature : values() )
+        {
+            names[pos] = disallowFeature.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
+    
+    /**
      * Get the DisallowFeatureEnumd instance from its number
      * 
      * @param number The number we are looking for

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecStyleEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecStyleEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecStyleEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecStyleEnum.java
Wed Jul 15 14:25:11 2015
@@ -88,7 +88,7 @@ public enum DnSpecStyleEnum
     
         for ( DnSpecStyleEnum dnSpecStyle : values() )
         {
-            names[pos] = dnSpecStyle.getName();
+            names[pos] = dnSpecStyle.name;
             pos++;
         }
         

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecTypeEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecTypeEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecTypeEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/DnSpecTypeEnum.java
Wed Jul 15 14:25:11 2015
@@ -81,7 +81,7 @@ public enum DnSpecTypeEnum
     
         for ( DnSpecTypeEnum dnSpecType : values() )
         {
-            names[pos] = dnSpecType.getName();
+            names[pos] = dnSpecType.name;
             pos++;
         }
         

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LimitSelectorEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LimitSelectorEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LimitSelectorEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LimitSelectorEnum.java
Wed Jul 15 14:25:11 2015
@@ -45,6 +45,7 @@ public enum LimitSelectorEnum
         this.name = name;
     }
 
+    
     /**
      * @return the text
      */
@@ -52,7 +53,25 @@ public enum LimitSelectorEnum
     {
         return name;
     }
+
+    
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
     
+        for ( LimitSelectorEnum limitSelector : values() )
+        {
+            names[pos] = limitSelector.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * Retrieve the instance associated to a String. Return NONE if not found.

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogLevelEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogLevelEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogLevelEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogLevelEnum.java
Wed Jul 15 14:25:11 2015
@@ -43,36 +43,40 @@ package org.apache.directory.studio.open
  */
 public enum LogLevelEnum
 {
-    NONE(0),
-    TRACE(1),
-    PACKETS(2),
-    ARGS(4),
-    CONNS(8),
-    BER(16),
-    FILTER(32),
-    CONFIG(64),
-    ACL(128),
-    STATS(256),
-    STATS2(512),
-    SHELL(1024),
-    PARSE(2048),
+    NONE( "none", 0 ),
+    TRACE( "trace", 1 ),
+    PACKETS( "packets", 2 ),
+    ARGS( "args", 4 ),
+    CONNS( "conns", 8 ),
+    BER( "ber", 16 ),
+    FILTER( "filter", 32 ),
+    CONFIG( "config", 64 ),
+    ACL( "acl", 128 ),
+    STATS( "stats", 256 ),
+    STATS2( "stats2", 512 ),
+    SHELL( "shell", 1024 ),
+    PARSE( "parse", 2048 ),
     // 4096 not used
     // 8196 not used
-    SYNC(16384),
+    SYNC( "sync", 16384 ),
     // 327168 and -1 are equivalent
-    ANY(-1);
+    ANY( "any", -1 );
     
     /** The inner value */
     private int value;
     
+    /** The inner name */
+    private String name;
+    
     
     /**
      * Creates a new instance of LogLevel.
      *
      * @param value The internal value
      */
-    private LogLevelEnum( int value )
+    private LogLevelEnum( String name, int value )
     {
+        this.name = name;
         this.value = value;
     }
     
@@ -84,7 +88,34 @@ public enum LogLevelEnum
     {
         return value;
     }
+
+    
+    /**
+     * @return the text
+     */
+    public String getName()
+    {
+        return name;
+    }
+
     
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( LogLevelEnum logLevel : values() )
+        {
+            names[pos] = logLevel.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * @param logLevel The integer value of the LogLevel

Copied: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperationEnum.java
(from r1689488, directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperation.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperationEnum.java?p2=directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperationEnum.java&p1=directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperation.java&r1=1689488&r2=1691227&rev=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperation.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/LogOperationEnum.java
Wed Jul 15 14:25:11 2015
@@ -21,45 +21,65 @@ package org.apache.directory.studio.open
 
 
 /**
- * This enums represents the various access log operation.
+ * This enum represents the various access log operation.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum LogOperation
+public enum LogOperationEnum
 {
-    WRITES("writes"),
-    ADD("add"),
-    DELETE("delete"),
-    MODIFY("modify"),
-    MODIFY_RDN("modrdn"),
-    READS("reads"),
-    COMPARE("compare"),
-    SEARCH("search"),
-    SESSION("session"),
-    ABANDON("abandon"),
-    BIND("bind"),
-    UNBIND("unbind"),
-    ALL("all");
+    WRITES( "writes" ),
+    ADD( "add" ),
+    DELETE( "delete" ),
+    MODIFY( "modify" ),
+    MODIFY_RDN( "modrdn" ),
+    READS( "reads" ),
+    COMPARE( "compare" ),
+    SEARCH( "search" ),
+    SESSION( "session" ),
+    ABANDON( "abandon" ),
+    BIND( "bind" ),
+    UNBIND( "unbind" ),
+    ALL( "all" );
 
-    /** The value */
-    protected String value;
+    /** The name */
+    private String name;
 
 
     /**
      * Creates a new instance of LogOperation.
      *
-     * @param value the value
+     * @param name the name
      */
-    private LogOperation( String value )
+    private LogOperationEnum( String name )
     {
-        this.value = value;
+        this.name = name;
     }
 
+    
+    /**
+     * @return the text
+     */
+    public String getName()
+    {
+        return name;
+    }
 
+    
     /**
-     * {@inheritDoc}
+     * @return An array with all the Enum value's name
      */
-    public String toString()
+    public static String[] getNames()
     {
-        return value;
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( LogOperationEnum logOperation : values() )
+        {
+            names[pos] = logOperation.name;
+            pos++;
+        }
+        
+        return names;
     }
 
 
@@ -69,59 +89,59 @@ public enum LogOperation
      * @param s the string
      * @return the corresponding log operation
      */
-    public static  LogOperation fromString( String s )
+    public static  LogOperationEnum fromString( String s )
     {
         if ( s != null )
         {
-            if ( s.equalsIgnoreCase( WRITES.value ) )
+            if ( s.equalsIgnoreCase( WRITES.name ) )
             {
                 return WRITES;
             }
-            else if ( s.equalsIgnoreCase( ADD.value ) )
+            else if ( s.equalsIgnoreCase( ADD.name ) )
             {
                 return ADD;
             }
-            else if ( s.equalsIgnoreCase( DELETE.value ) )
+            else if ( s.equalsIgnoreCase( DELETE.name ) )
             {
                 return DELETE;
             }
-            else if ( s.equalsIgnoreCase( MODIFY.value ) )
+            else if ( s.equalsIgnoreCase( MODIFY.name ) )
             {
                 return MODIFY;
             }
-            else if ( s.equalsIgnoreCase( MODIFY_RDN.value ) )
+            else if ( s.equalsIgnoreCase( MODIFY_RDN.name ) )
             {
                 return MODIFY_RDN;
             }
-            else if ( s.equalsIgnoreCase( READS.value ) )
+            else if ( s.equalsIgnoreCase( READS.name ) )
             {
                 return READS;
             }
-            else if ( s.equalsIgnoreCase( COMPARE.value ) )
+            else if ( s.equalsIgnoreCase( COMPARE.name ) )
             {
                 return COMPARE;
             }
-            else if ( s.equalsIgnoreCase( SEARCH.value ) )
+            else if ( s.equalsIgnoreCase( SEARCH.name ) )
             {
                 return SEARCH;
             }
-            else if ( s.equalsIgnoreCase( SESSION.value ) )
+            else if ( s.equalsIgnoreCase( SESSION.name ) )
             {
                 return SESSION;
             }
-            else if ( s.equalsIgnoreCase( ABANDON.value ) )
+            else if ( s.equalsIgnoreCase( ABANDON.name ) )
             {
                 return ABANDON;
             }
-            else if ( s.equalsIgnoreCase( BIND.value ) )
+            else if ( s.equalsIgnoreCase( BIND.name ) )
             {
                 return BIND;
             }
-            else if ( s.equalsIgnoreCase( UNBIND.value ) )
+            else if ( s.equalsIgnoreCase( UNBIND.name ) )
             {
                 return UNBIND;
             }
-            else if ( s.equalsIgnoreCase( ALL.value ) )
+            else if ( s.equalsIgnoreCase( ALL.name ) )
             {
                 return ALL;
             }

Added: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/OverlayTypeEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/OverlayTypeEnum.java?rev=1691227&view=auto
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/OverlayTypeEnum.java
(added)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/OverlayTypeEnum.java
Wed Jul 15 14:25:11 2015
@@ -0,0 +1,93 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.openldap.common.ui.model;
+
+
+/**
+ * This enum represents the list of Overlays
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum OverlayTypeEnum
+{
+    /** Access Log */
+    ACCESS_LOG( "Access Log" ),
+
+    /** Audit Log */
+    AUDIT_LOG( "Audit Log" ),
+
+    /** Member Of */
+    MEMBER_OF( "Member Of" ),
+
+    /** Password Policy */
+    PASSWORD_POLICY( "Password Policy" ),
+
+    /** Referential Integrity */
+    REFERENTIAL_INTEGRITY( "Referential Integrity" ),
+
+    /** Rewrite/Remap */
+    REWRITE_REMAP( "Rewrite/Remap" ),
+
+    /** Sync Prov (Replication) */
+    SYNC_PROV( "Sync Prov (Replication)" ),
+    
+    /** Value Sorting */
+    VALUE_SORTING( "Value Sorting" ),
+    
+    /** Unknown */
+    NONE( "" );
+    
+    /** The Overlay name */
+    private String name;
+    
+    /**
+     * Create an instance of an OverlayTypeEnum
+     */
+    private OverlayTypeEnum( String name )
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( OverlayTypeEnum overlayType : values() )
+        {
+            names[pos] = overlayType.name;
+            pos++;
+        }
+        
+        return names;
+    }
+}

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/PasswordHashEnum.java
Wed Jul 15 14:25:11 2015
@@ -58,7 +58,25 @@ public enum PasswordHashEnum
     {
         return name;
     }
+
     
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( PasswordHashEnum passwordHash : values() )
+        {
+            names[pos] = passwordHash.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * @return The Password Hash number

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RequireConditionEnum.java
Wed Jul 15 14:25:11 2015
@@ -61,7 +61,25 @@ public enum RequireConditionEnum
     {
         return name;
     }
+
     
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( RequireConditionEnum requireCondition : values() )
+        {
+            names[pos] = requireCondition.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * Get the RequireConditionEnum instance from its number

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/RestrictOperationEnum.java
Wed Jul 15 14:25:11 2015
@@ -85,7 +85,25 @@ public enum RestrictOperationEnum
     {
         return name;
     }
+
     
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( RestrictOperationEnum restrictOperation : values() )
+        {
+            names[pos] = restrictOperation.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * @return the external name

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SaslSecPropEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SaslSecPropEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SaslSecPropEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SaslSecPropEnum.java
Wed Jul 15 14:25:11 2015
@@ -81,7 +81,25 @@ public enum SaslSecPropEnum
     {
         return name;
     }
+
+    
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
     
+        for ( SaslSecPropEnum saslSecProp : values() )
+        {
+            names[pos] = saslSecProp.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
 
     /**
      * @return the hasValue flag

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfFeatureEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfFeatureEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfFeatureEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfFeatureEnum.java
Wed Jul 15 14:25:11 2015
@@ -56,7 +56,25 @@ public enum SsfFeatureEnum
     {
         return name;
     }
+
     
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
+    {
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( SsfFeatureEnum ssfFeature : values() )
+        {
+            names[pos] = ssfFeature.name;
+            pos++;
+        }
+        
+        return names;
+    }
+
     
     /**
      * Retrieve the instance associated to a String. Return NONE if not found.

Modified: directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfStrengthEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfStrengthEnum.java?rev=1691227&r1=1691226&r2=1691227&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfStrengthEnum.java
(original)
+++ directory/studio/trunk/plugins/openldap.common.ui/src/main/java/org/apache/directory/studio/openldap/common/ui/model/SsfStrengthEnum.java
Wed Jul 15 14:25:11 2015
@@ -34,27 +34,47 @@ public enum SsfStrengthEnum
     AES_128( 128, "AES-128" ),
     AES_256( 256, "AES-256" );
     
-    /** The associated Text */
-    private String text;
+    /** The associated name */
+    private String name;
     
     /** The SSF strength position */
     private int nbBits;
+    
     /**
      * Creates an SsfEnum instance
      */
-    private SsfStrengthEnum( int nbBits, String text )
+    private SsfStrengthEnum( int nbBits, String name )
     {
         this.nbBits = nbBits;
-        this.text = text;
+        this.name = name;
     }
 
     /**
      * @return the text
      */
-    public String getText()
+    public String getName()
+    {
+        return name;
+    }
+
+    
+    /**
+     * @return An array with all the Enum value's name
+     */
+    public static String[] getNames()
     {
-        return text;
+        String[] names = new String[values().length];
+        int pos = 0;
+    
+        for ( SsfStrengthEnum ssfStrength : values() )
+        {
+            names[pos] = ssfStrength.name;
+            pos++;
+        }
+        
+        return names;
     }
+    
 
     /**
      * @return the number of bits
@@ -95,7 +115,7 @@ public enum SsfStrengthEnum
     {
         for ( SsfStrengthEnum ssfStrength : values() )
         {
-            if ( ssfStrength.text.equalsIgnoreCase( text ) )
+            if ( ssfStrength.name.equalsIgnoreCase( text ) )
             {
                 return ssfStrength;
             }



Mime
View raw message