return (S) etype.getDeclaredField(s).get(null);
Field f = etype.getDeclaredField(s); if (! f.isEnumConstant()) throw new IllegalArgumentException(s); return (S) f.get(null);
  public static <S extends Enum<S>> S valueOf(Class<S> etype, String s)  {        if (etype == null || s == null)            throw new NullPointerException();    try      {            return (S) etype.getDeclaredField(s).get(null);      }    catch (NoSuchFieldException exception)      {            throw new IllegalArgumentException(s);      }    catch (IllegalAccessException exception)      {            throw new Error("Unable to access Enum class");        }    }