private Endpoint withoutIpAddr() {
        if (ipAddr == null) {
            return this;
        }

        if (isIpAddrOnly()) {
            throw new IllegalStateException("can't clear the IP address if host name is an IP address: " +
                                            this);
        }

        assert type == Type.HOSTNAME_AND_IP : type;
        return new Endpoint(Type.HOSTNAME_ONLY, host, null, port, weight, attributes);
    }
Returns a new host endpoint with the {@linkplain InetAddress#getHostAddress() IP address} of
the specified {@link InetAddress}.

@return the new endpoint with the specified {@link InetAddress}.
        {@code this} if this endpoint has the same IP address.
core/src/main/java/com/linecorp/armeria/client/Endpoint.java