code: public static <T extends Enum<T>> T getEnum(Class<T> enumClass, AbstractConfig config, String key) {
      Preconditions.checkNotNull(enumClass, "enumClass cannot be null");
      Preconditions.checkState(enumClass.isEnum(), "enumClass must be an enum.");
      String textValue = config.getString(key);
      return Enum.valueOf(enumClass, textValue);
    }
docs: Method is used to return an enum value from a given string.
  
  @param enumClass Class for the resulting enum value
  @param config    config to read the value from
  @param key       key for the value
  @param <T>       Enum class to return type for.
  @return enum value for the given key.
  @see ValidEnum