public Builder addEndpoint(String endpoint) {
            try {
                URL endpointURL = new java.net.URL(endpoint);

                if (endpointURL.getProtocol().equalsIgnoreCase("https")) {
                    addEndpoint(Protocol.HTTP, endpointURL.getHost(), endpointURL.getPort(), true);
                } else if (endpointURL.getProtocol().equalsIgnoreCase("http")) {
                    addEndpoint(Protocol.HTTP, endpointURL.getHost(), endpointURL.getPort(), false);
                } else {
                    throw new IllegalArgumentException("Only HTTP and HTTPS protocols are supported");
                }
            } catch (java.net.MalformedURLException e) {
                throw new IllegalArgumentException("Endpoint should be a valid URL string, but was " + endpoint, e);
            }
            return this;
        }
Server address to which client may connect. If there are multiple endpoints then client will
connect to one of them.
Acceptable formats are:
<ul>
    <li>{@code http://localhost:8123}</li>
    <li>{@code https://localhost:8443}</li>
</ul>

@param endpoint - URL formatted string with protocol, host and port.
client-v2/src/main/java/com/clickhouse/client/api/Client.java