Example usage for Java com.google.common.net HostAndPort fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | equals(@Nullable Object other) |
HostAndPort | fromHost(String host) Build a HostAndPort instance from a host only. |
HostAndPort | fromParts(String host, int port) Build a HostAndPort instance from separate host and port values. |
HostAndPort | fromString(String hostPortString) Split a freeform string into a host and port, without strict validation. |
String | getHostText() Returns the portion of this HostAndPort instance that should represent the hostname or IPv4/IPv6 literal. |
int | getPort() Get the current port number, failing if no port is defined. |
int | getPortOrDefault(int defaultPort) Returns the current port number, with a default if no port is defined. |
boolean | hasPort() Return true if this instance has a defined port. |
HostAndPort | requireBracketsForIPv6() Generate an error if the host might be a non-bracketed IPv6 literal. |
String | toString() Rebuild the host:port string, including brackets if necessary. |
HostAndPort | withDefaultPort(int defaultPort) Provide a default port if the parsed string contained only a host. |