@Contract(threading=IMMUTABLE) public final class URIAuthority extends Object implements NamedEndpoint, Serializable
URI.| Constructor and Description |
|---|
URIAuthority(Host host)
Constructs a new instance.
|
URIAuthority(NamedEndpoint namedEndpoint)
Constructs a new instance.
|
URIAuthority(String hostName)
Constructs a new instance.
|
URIAuthority(String userInfo,
Host host)
Constructs a new instance.
|
URIAuthority(String hostName,
int port)
Constructs a new instance.
|
URIAuthority(String userInfo,
NamedEndpoint endpoint)
Constructs a new instance.
|
URIAuthority(String userInfo,
String hostName,
int port)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
static URIAuthority |
create(String s)
Creates a
URIAuthority instance from a string. |
boolean |
equals(Object obj) |
String |
getHostName()
Returns name (IP or DNS name).
|
int |
getPort()
Returns the port.
|
String |
getUserInfo()
Gets the user info String.
|
int |
hashCode() |
String |
toString() |
public URIAuthority(String userInfo, String hostName, int port)
userInfo - The user info, may be null.hostName - 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 is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-1 indicates the scheme default port.public URIAuthority(String hostName, int port)
hostName - 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 is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-1 indicates the scheme default port.public URIAuthority(String userInfo, Host host)
userInfo - The user info, may be null.host - The host, never null.NullPointerException - if the host is null.public URIAuthority(Host host)
host - The host, never null.NullPointerException - if the host is null.public URIAuthority(String userInfo, NamedEndpoint endpoint)
userInfo - The user info, may be null.endpoint - The named end-point, never null.NullPointerException - If the end-point is null.NullPointerException - If the end-point name is null.IllegalArgumentException - If the end-point port is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-1 indicates the scheme default port.public URIAuthority(NamedEndpoint namedEndpoint)
namedEndpoint - The named end-point, never null.NullPointerException - If the end-point is null.NullPointerException - If the end-point name is null.IllegalArgumentException - If the end-point port is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-1 indicates the scheme default port.public URIAuthority(String hostName)
hostName - The host name, not null.NullPointerException - If the name is null.public static URIAuthority create(String s) throws URISyntaxException
URIAuthority instance from a string. Text may not contain any blanks.s - The value to parseURISyntaxException - Thrown if a string could not be parsed as a URIAuthority.public String getUserInfo()
public 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.