public final class HostPort extends Object
| Constructor and Description |
|---|
HostPort(String host,
int port)
Construct a host and port address combination.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
host()
Returns the host name or IP address.
|
static HostPort |
parse(String hostport)
Parses a string of the form "host:port" into a HostPort instance.
|
int |
port()
Returns the port.
|
String |
toString() |
public HostPort(String host, int port)
host - the host name or IP addressport - the portpublic String host()
public int port()
public static HostPort parse(String hostport) throws IllegalArgumentException
hostport - string to parseIllegalArgumentException - if format is invalid.