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 Hostboolean(package private) static voidformat(StringBuilder buf, Host host) (package private) static voidformat(StringBuilder buf, NamedEndpoint endpoint) (package private) static StringReturns name (IP or DNS name).intgetPort()Returns the port.inthashCode()(package private) static Host(package private) static Hostparse(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:NamedEndpointReturns name (IP or DNS name).- Specified by:
getHostNamein interfaceNamedEndpoint- Returns:
- the host name (IP or DNS name)
-
getPort
public int getPort()Description copied from interface:NamedEndpointReturns the port.- Specified by:
getPortin interfaceNamedEndpoint- Returns:
- the host port, or
-1if not set
-
equals
-
hashCode
public int hashCode() -
toString
-