public static <E extends Enum<E>> E getEnum(final Class<E> enumClass, final String enumName) {
        if (enumName == null) {
            return null;
        }
        try {
            return Enum.valueOf(enumClass, enumName);
        } catch (final IllegalArgumentException ex) {
            return null;
        }
    }
public static < E extends Enum < E > > E getEnum ( final Class < E > enumClass , final String enumName ) { if ( enumName == null ) { return null ; } try { return Enum . valueOf ( enumClass , enumName ) ; } catch ( final IllegalArgumentException ex ) { return null ; } }
<p>Gets the enum for the class, returning {@code null} if not found.</p>

<p>This method differs from {@link Enum#valueOf} in that it does not throw an exception
for an invalid enum name.</p>

@param <E> the type of the enumeration
@param enumClass  the class of the enum to query, not null
@param enumName   the enum name, null returns null
@return the enum, null if not found