@Contract(threading=IMMUTABLE) public final class Host extends Object implements NamedEndpoint, Serializable
| Constructor and Description |
|---|
Host(String name,
int port)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
static Host |
create(String s) |
boolean |
equals(Object o) |
String |
getHostName()
Returns name (IP or DNS name).
|
int |
getPort()
Returns the port.
|
int |
hashCode() |
String |
toString() |
public Host(String name, int port)
name - The host name, not null.port - The port value, between 0 and 65535, inclusive. -1 indicates the scheme default port.NullPointerException - if the name is null.IllegalArgumentException - If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-1 indicates the scheme default port.public static Host create(String s) throws URISyntaxException
URISyntaxExceptionpublic String getHostName()
NamedEndpointgetHostName in interface NamedEndpointpublic int getPort()
NamedEndpointgetPort in interface NamedEndpoint-1 if not setCopyright © 2005–2021 The Apache Software Foundation. All rights reserved.