private static String generateAuthority(Type type, String host, int port) {
        switch (type) {
            case DOMAIN_SOCKET:
                return host;
            case IP_ONLY:
                if (isIpV6(host)) {
                    if (port != 0) {
                        return '[' + host + "]:" + port;
                    } else {
                        return '[' + host + ']';
                    }
                }
                // fall-through
            default:
                if (hasTrailingDot(host)) {
                    // Strip the trailing dot for the authority.
                    host = host.substring(0, host.length() - 1);
                }
                return port != 0 ? host + ':' + port : host;
        }
    }
Creates a new host {@link Endpoint} <strong>without</strong> validation.

<p>Note that you should carefully use this method only when both {@code host} and {@code port} are
already valid.
core/src/main/java/com/linecorp/armeria/client/Endpoint.java