Package org.apache.hc.core5.net
Class URIAuthority
java.lang.Object
org.apache.hc.core5.net.URIAuthority
- All Implemented Interfaces:
Serializable
,NamedEndpoint
@Contract(threading=IMMUTABLE)
public final class URIAuthority
extends Object
implements NamedEndpoint, Serializable
Represents authority component of request
URI
.- Since:
- 5.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionURIAuthority
(String hostname) URIAuthority
(String hostname, int port) URIAuthority
(String userInfo, String hostname, int port) Constructs a new instance.URIAuthority
(String userInfo, Host host) URIAuthority
(String userInfo, NamedEndpoint endpoint) URIAuthority
(Host host) URIAuthority
(NamedEndpoint namedEndpoint) -
Method Summary
Modifier and TypeMethodDescriptionstatic URIAuthority
Creates aURIAuthority
instance from a string.boolean
(package private) static void
format
(StringBuilder buf, URIAuthority uriAuthority) (package private) static String
format
(URIAuthority uriAuthority) Returns name (IP or DNS name).int
getPort()
Returns the port.int
hashCode()
(package private) static URIAuthority
(package private) static URIAuthority
parse
(CharSequence s, Tokenizer.Cursor cursor) toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
userInfo
-
host
-
-
Constructor Details
-
URIAuthority
Constructs a new instance.- Throws:
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.
-
URIAuthority
-
URIAuthority
- Since:
- 5.2
-
URIAuthority
- Since:
- 5.2
-
URIAuthority
- Since:
- 5.2
-
URIAuthority
-
URIAuthority
-
-
Method Details
-
parse
- Throws:
URISyntaxException
-
parse
- Throws:
URISyntaxException
-
format
-
format
-
create
Creates aURIAuthority
instance from a string. Text may not contain any blanks.- Throws:
URISyntaxException
-
getUserInfo
-
getHostName
Description copied from interface:NamedEndpoint
Returns name (IP or DNS name).- Specified by:
getHostName
in interfaceNamedEndpoint
- Returns:
- the host name (IP or DNS name)
-
getPort
public int getPort()Description copied from interface:NamedEndpoint
Returns the port.- Specified by:
getPort
in interfaceNamedEndpoint
- Returns:
- the host port, or
-1
if not set
-
toString
-
equals
-
hashCode
public int hashCode()
-