@SuppressWarnings("unchecked")
    static <T extends Serializable> T fromString(String value, T defaultValue) {
        if (defaultValue == null) {
            throw new IllegalArgumentException("Non-null default value is required");
        }
        if (value == null || value.isEmpty()) {
            return defaultValue;
        }

        return (T) fromString(value, defaultValue.getClass());
    }
Converts given string to typed value. When {@code value} is null or blank,
{@code defaultValue} will be returned.

@param <T>          type of the value
@param value        value in string format
@param defaultValue non-null default value
@return non-null typed value
clickhouse-data/src/main/java/com/clickhouse/config/ClickHouseOption.java