public Endpoint withoutDefaultPort(int defaultPort) {
        validatePort("defaultPort", defaultPort);
        if (isDomainSocket()) {
            // A domain socket always has the predefined port number.
            return this;
        }
        if (port == defaultPort) {
            return new Endpoint(type, host, ipAddr, 0, weight, attributes);
        }
        return this;
    }
Returns a new host endpoint with the default port number removed.

@param defaultPort the default port number
@return the new endpoint without a port number if this endpoint had the same port number
        with the specified default port number. {@code this} if this endpoint had a different
        port number than the specified default port number or this endpoint already does not have
        a port number.
core/src/main/java/com/linecorp/armeria/client/Endpoint.java