default <T extends Enum<T>> T asEnum(Class<T> enumType) {
        if (isNullOrEmpty()) {
            return null;
        }

        int value = asInteger();
        for (T t : ClickHouseChecker.nonNull(enumType, ClickHouseValues.TYPE_CLASS).getEnumConstants()) {
            if (t.ordinal() == value) {
                return t;
            }
        }

        throw new IllegalArgumentException(
                ClickHouseUtils.format("Ordinal[%d] not found in %s", value, enumType.getName()));
    }
Gets value as enum.

@param <T>      type of the enum
@param enumType enum class
@return enum, could be null
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseValue.java