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

Method fromHost

corpus/java/training/guava/net/HostAndPort.java:150–154  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

fromStringMethod · 0.95
hasPortMethod · 0.95
checkArgumentMethod · 0.45

Tested by

no test coverage detected