MCPcopy Create free account
hub / github.com/antlr/codebuff / fromParts

Method fromParts

output/java_guava/1.4.17/HostAndPort.java:141–146  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

isValidPortMethod · 0.95
fromStringMethod · 0.95
hasPortMethod · 0.95
checkArgumentMethod · 0.45

Tested by

no test coverage detected