public class HttpHost extends Object implements Cloneable
| 构造器和说明 |
|---|
HttpHost(HttpHost httphost)
Copy constructor for HttpHost
|
HttpHost(String hostname)
Constructor for HttpHost.
|
HttpHost(String hostname,
int port)
Constructor for HttpHost.
|
HttpHost(String hostname,
int port,
Protocol protocol)
Constructor for HttpHost.
|
HttpHost(URI uri)
URI constructor for HttpHost.
|
public HttpHost(String hostname, int port, Protocol protocol)
hostname - the hostname (IP or DNS name). Can be null.port - the port. Value -1 can be used to set default protocol portprotocol - the protocol. Value null can be used to set default protocolpublic HttpHost(String hostname, int port)
hostname - the hostname (IP or DNS name). Can be null.port - the port. Value -1 can be used to set default protocol portpublic HttpHost(String hostname)
hostname - the hostname (IP or DNS name). Can be null.public HttpHost(URI uri) throws URIException
uri - the URI.URIExceptionpublic HttpHost(HttpHost httphost)
httphost - the HTTP host to copy details frompublic Object clone()
clone 在类中 ObjectObject.clone()public String getHostName()
null if not setpublic int getPort()
-1 if not setpublic Protocol getProtocol()
public String toURI()
public String toString()
toString 在类中 ObjectObject.toString()public boolean equals(Object o)
equals 在类中 ObjectObject.equals(Object)public int hashCode()
hashCode 在类中 ObjectObject.hashCode()Copyright © 2017. All rights reserved.