Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package org.litesoft.commonfoundation.typeutils;

public class Enums
{
    public static <T extends Enum<T>> T fromString( Class<T> pClass, String pEnumAsString )
    {
        if ( pClass != null )
        {
            if ( null != (pEnumAsString = Strings.noEmpty( pEnumAsString )) )
            {
                try
                {
                    return Enum.valueOf( pClass, pEnumAsString );
                }
                catch ( IllegalArgumentException ex )
                {
                    // Bad String
                }
            }
        }
        return null;
    }
}

Commits for litesoft/trunk/DeviceDesktopTest/src/org/litesoft/commonfoundation/typeutils/Enums.java

Diff revisions: vs.
Revision Author Commited Message
943 Diff Diff GeorgeS picture GeorgeS Tue 03 Jun, 2014 04:25:50 +0000

Extracting commonfoundation

936 GeorgeS picture GeorgeS Sun 01 Jun, 2014 20:19:38 +0000

Language Support