public static ClickHouseEnumValue of(ClickHouseValue ref, ClickHouseEnum type, int value) {
        return ref instanceof ClickHouseEnumValue ? ((ClickHouseEnumValue) ref).set(false, value)
                : new ClickHouseEnumValue(type, false, value);
    }
Update value of the given object or create a new instance if {@code ref} is
null.

@param ref   object to update, could be null
@param type  enum type, null is same as {@link ClickHouseEnum#EMPTY}
@param value value
@return same object as {@code ref} or a new instance if it's null
clickhouse-data/src/main/java/com/clickhouse/data/value/ClickHouseEnumValue.java