code: public static Object getEnumConstantByName(Class klass, String name) {
      name = name.toUpperCase();
      Object c[] = klass.getEnumConstants();
      for (int ix = 0; ix < c.length; ix++)
        if (c[ix].toString().equals(name))
          return c[ix];
      throw new DukeConfigException("No such " + klass + ": '" + name + "'");
    }
docs: Returns the enum constant from the given enum class representing
  the constant with the given identifier/name.