presto-spi/src/main/java/io/prestosql/spi/session/PropertyMetadata.java/PropertyMetadata/enumProperty
class PropertyMetadata:    public static <T extends Enum<T>> PropertyMetadata<T> enumProperty(String name, String descriptionPrefix, Class<T> type, T defaultValue, boolean hidden)
    {
        String allValues = EnumSet.allOf(type).stream()
                .map(Enum::name)
                .collect(joining(", ", "[", "]"));
        return new PropertyMetadata<>(
                name,
                format("%s. Possible values: %s", descriptionPrefix, allValues),
                createUnboundedVarcharType(),
                type,
                defaultValue,
                hidden,
                value -> {
                    try {
                        return Enum.valueOf(type, ((String) value).toUpperCase(ENGLISH));
                    }
                    catch (IllegalArgumentException e) {
                        throw new IllegalArgumentException(format("Invalid value [%s]. Valid values: %s", value, allValues), e);
                    }
                },
                Enum::name);
    }