- fromParts
Build a HostAndPort instance from separate host and port values.Note:
Non-bracketed IPv6 literals ar
- getPort
Get the current port number, failing if no port is defined.
- fromString
Split a freeform string into a host and port, without strict validation. Note
that the host-only for
- getHostText
Returns the portion of this HostAndPort instance that should represent the
hostname or IPv4/IPv6 lit
- getHost
Returns the portion of this HostAndPort instance that should represent the
hostname or IPv4/IPv6 lit
- toString
Rebuild the host:port string, including brackets if necessary.
- getPortOrDefault
Returns the current port number, with a default if no port is defined.
- hasPort
Return true if this instance has a defined port.
- withDefaultPort
Provide a default port if the parsed string contained only a host. You can chain
this after #fromStr
- <init>
- isValidPort
Return true for valid port numbers.
- getHostAndPortFromBracketedHost
Parses a bracketed host-port string, throwing IllegalArgumentException if
parsing fails.