@SuppressWarnings("unchecked")
  public static <E extends Enum<?>> E convertToEnum(Object o, Class<E> clazz) {
    if (o.getClass().equals(clazz)) {
      return (E) o;
    }

    return Arrays.stream(clazz.getEnumConstants())
        .filter(
            e ->
                e.toString().toUpperCase(Locale.ROOT).equals(o.toString().toUpperCase(Locale.ROOT)))
        .findAny()
        .orElseThrow(
            () ->
                new IllegalArgumentException(
                    String.format(
                        "Could not parse value for enum %s. Expected one of: [%s]",
                        clazz, Arrays.toString(clazz.getEnumConstants()))));
  }
Convert System Env key to Configuration key For Example : AMS_DATABASE_PASSWORD --->
ams.database.password AMS_SERVER__EXPOSE__HOST ---> ams.server-expose-host
amoro-common/src/main/java/org/apache/amoro/config/ConfigHelpers.java