Build a HostAndPort instance from separate host and port values. Note: Non-bracketed IPv6 literals are allowed. Use #requireBracketsForIPv6() to prohibit these. @param host the host string to parse. Must not contain a port number. @param port a port number from [0..65535] @return if par
(String host, int port)
| 139 | |
| 140 | |
| 141 | public static HostAndPort fromParts(String host, int port) { |
| 142 | checkArgument(isValidPort(port), "Port out of range: %s", port); |
| 143 | HostAndPort parsedHost = fromString(host); |
| 144 | checkArgument(!parsedHost.hasPort(), "Host has a port: %s", host); |
| 145 | return new HostAndPort(parsedHost.host, port, parsedHost.hasBracketlessColons); |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Build a HostAndPort instance from a host only. |
nothing calls this directly
no test coverage detected