public final class HttpHost
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SCHEME_NAME
The default scheme is "http".
|
protected java.lang.String |
hostname
The host to use.
|
protected java.lang.String |
lcHostname
The lowercase host, for
equals(java.lang.Object) and hashCode() . |
protected int |
port
The port to use.
|
protected java.lang.String |
schemeName
The scheme
|
Constructor and Description |
---|
HttpHost(HttpHost httphost)
Copy constructor for
HttpHost . |
HttpHost(java.lang.String hostname)
Creates a new
HttpHost , with default scheme and port. |
HttpHost(java.lang.String hostname,
int port)
Creates a new
HttpHost , with default scheme. |
HttpHost(java.lang.String hostname,
int port,
java.lang.String scheme)
Creates a new
HttpHost , specifying all values. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getHostName()
Returns the host name.
|
int |
getPort()
Returns the port.
|
java.lang.String |
getSchemeName()
Returns the scheme name.
|
int |
hashCode() |
java.lang.String |
toHostString()
Obtains the host string, without scheme prefix.
|
java.lang.String |
toString() |
java.lang.String |
toURI()
Return the host URI, as a string.
|
public static final java.lang.String DEFAULT_SCHEME_NAME
protected final java.lang.String hostname
protected final java.lang.String lcHostname
equals(java.lang.Object)
and hashCode()
.protected final int port
protected final java.lang.String schemeName
public HttpHost(java.lang.String hostname, int port, java.lang.String scheme)
HttpHost
, specifying all values.
Constructor for HttpHost.hostname
- the hostname (IP or DNS name)port
- the port number.
-1
indicates the scheme default port.scheme
- the name of the scheme.
null
indicates the
default scheme
public HttpHost(java.lang.String hostname, int port)
HttpHost
, with default scheme.hostname
- the hostname (IP or DNS name)port
- the port number.
-1
indicates the scheme default port.public HttpHost(java.lang.String hostname)
HttpHost
, with default scheme and port.hostname
- the hostname (IP or DNS name)public java.lang.String getHostName()
public int getPort()
-1
if not setpublic java.lang.String getSchemeName()
public java.lang.String toURI()
public java.lang.String toHostString()
localhost:8080
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException