Package org.apache.hc.core5.net
Class Host
java.lang.Object
org.apache.hc.core5.net.Host
- All Implemented Interfaces:
Serializable
,NamedEndpoint
@Contract(threading=IMMUTABLE)
public final class Host
extends Object
implements NamedEndpoint, Serializable
Component that holds all details needed to describe a network connection
to a host. This includes remote host name and port.
- Since:
- 5.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Host
boolean
(package private) static void
format
(StringBuilder buf, Host host) (package private) static void
format
(StringBuilder buf, NamedEndpoint endpoint) (package private) static String
Returns name (IP or DNS name).int
getPort()
Returns the port.int
hashCode()
(package private) static Host
(package private) static Host
parse
(CharSequence s, Tokenizer.Cursor cursor) toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
lcName
-
port
private final int port
-
-
Constructor Details
-
Host
-
-
Method Details
-
parse
- Throws:
URISyntaxException
-
parse
- Throws:
URISyntaxException
-
format
-
format
-
format
-
create
- Throws:
URISyntaxException
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-