Build a HostAndPort instance from a host only. Note: Non-bracketed IPv6 literals are allowed. Use #requireBracketsForIPv6() to prohibit these. @param host the host-only string to parse. Must not contain a port number. @return if parsing was successful, a populated HostAndPort object. @t
(String host)
| 159 | |
| 160 | |
| 161 | public static HostAndPort fromHost(String host) { |
| 162 | HostAndPort parsedHost = fromString(host); |
| 163 | checkArgument(!parsedHost.hasPort(), "Host has a port: %s", host); |
| 164 | return parsedHost; |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Split a freeform string into a host and port, without strict validation. |
nothing calls this directly
no test coverage detected