@SuppressWarnings("unchecked")
    public SelfT settings(Map<String, Serializable> settings) {
        checkSealed();

        if (changeListener == null) {
            this.settings.clear();
            if (settings != null) {
                for (Entry<String, Serializable> e : settings.entrySet()) {
                    set(e.getKey(), e.getValue());
                }
            }
            resetCache();
        } else {
            Map<String, Serializable> m = new HashMap<>();
            m.putAll(this.settings);
            if (settings != null) {
                for (Entry<String, Serializable> e : settings.entrySet()) {
                    set(e.getKey(), e.getValue());
                    m.remove(e.getKey());
                }
            }
            for (String s : m.keySet()) {
                removeSetting(s);
            }
        }

        return (SelfT) this;
    }
Sets all server settings. When {@code settings} is null or empty, it's same
as {@link #clearSettings()}.

@param settings settings
@return the request itself
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseRequest.java