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)
| 148 | * @since 17.0 |
| 149 | */ |
| 150 | public static HostAndPort fromHost(String host) { |
| 151 | HostAndPort parsedHost = fromString(host); |
| 152 | checkArgument(!parsedHost.hasPort(), "Host has a port: %s", host); |
| 153 | return parsedHost; |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Split a freeform string into a host and port, without strict validation. |
nothing calls this directly
no test coverage detected