public class HostPortPair
extends java.lang.Object
Constructor and Description |
---|
HostPortPair(java.lang.String host, int port)
Constructs a new
HostPortPair instance.
|
Modifier and Type | Method and Description |
---|---|
static HostPortPair |
fromString(java.lang.String hostPort) |
java.lang.String |
getHost() |
java.lang.String |
getHostPort() |
int |
getPort() |
boolean |
hasPort() |
public HostPortPair(java.lang.String host, int port)
HostPortPair
instance.
host
- string that represents host name.
-代表主机名的字符串。
port
- integer that represents port number.
-表示端口号的整数。
java.lang.IllegalArgumentException
- when
host
is
null
or empty.
java.lang.IllegalArgumentException
- when
port
is < 0.
public static HostPortPair fromString(java.lang.String hostPort)
public java.lang.String getHost()
public java.lang.String getHostPort()
public boolean hasPort()
public int getPort()