public static Endpoint parse(String authority) {
        requireNonNull(authority, "authority");
        checkArgument(!authority.isEmpty(), "authority is empty");
        return cache.get(authority, key -> {
            final SchemeAndAuthority schemeAndAuthority = SchemeAndAuthority.of(null, key);
            // If the port is undefined, set to 0
            final int port = schemeAndAuthority.port() == -1 ? 0 : schemeAndAuthority.port();
            return create(schemeAndAuthority.host(), port, true);
        });
    }
Parse the authority part of a URI. The authority part may have one of the following formats:
<ul>
  <li>{@code "<host>:<port>"} for a host endpoint (The userinfo part will be ignored.)</li>
  <li>{@code "<host>"}, {@code "<host>:"} for a host endpoint with no port number specified</li>
</ul>
An IPv4 or IPv6 address can be specified in lieu of a host name, e.g. {@code "127.0.0.1:8080"} and
{@code "[::1]:8080"}.
core/src/main/java/com/linecorp/armeria/client/Endpoint.java