commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject svn commit: r831687 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/EnumUtils.java test/org/apache/commons/lang/EnumUtilsTest.java
Date Sun, 01 Nov 2009 15:29:04 GMT
Author: scolebourne
Date: Sun Nov  1 15:29:04 2009
New Revision: 831687

URL: http://svn.apache.org/viewvc?rev=831687&view=rev
Log:
LANG-290 - Rename isEnum to isValidEnum

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/EnumUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java?rev=831687&r1=831686&r2=831687&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/EnumUtils.java Sun Nov  1 15:29:04
2009
@@ -73,7 +73,7 @@
      * @param enumClass  the class of the <code>enum</code> to get, not null
      * @return the map of enum names to enums, never null
      */
-    public static <E extends Enum<E>> boolean isEnum(Class<E> enumClass,
String enumName) {
+    public static <E extends Enum<E>> boolean isValidEnum(Class<E> enumClass,
String enumName) {
         try {
             Enum.valueOf(enumClass, enumName);
             return true;

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/EnumUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/EnumUtilsTest.java?rev=831687&r1=831686&r2=831687&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/EnumUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/EnumUtilsTest.java Sun Nov
 1 15:29:04 2009
@@ -60,10 +60,10 @@
     }
 
     public void test_isEnum() {
-        assertEquals(true, EnumUtils.isEnum(Traffic.class, "RED"));
-        assertEquals(true, EnumUtils.isEnum(Traffic.class, "AMBER"));
-        assertEquals(true, EnumUtils.isEnum(Traffic.class, "GREEN"));
-        assertEquals(false, EnumUtils.isEnum(Traffic.class, "PURPLE"));
+        assertEquals(true, EnumUtils.isValidEnum(Traffic.class, "RED"));
+        assertEquals(true, EnumUtils.isValidEnum(Traffic.class, "AMBER"));
+        assertEquals(true, EnumUtils.isValidEnum(Traffic.class, "GREEN"));
+        assertEquals(false, EnumUtils.isValidEnum(Traffic.class, "PURPLE"));
     }
 
     public void test_getEnum() {



Mime
View raw message