public final class Address extends Object
HTTP requests that share the same Address
may also share the same
Connection
.
Constructor and Description |
---|
Address(String uriHost,
int uriPort,
Dns dns,
SocketFactory socketFactory,
SSLSocketFactory sslSocketFactory,
HostnameVerifier hostnameVerifier,
CertificatePinner certificatePinner,
Authenticator authenticator,
Proxy proxy,
List<Protocol> protocols,
List<ConnectionSpec> connectionSpecs,
ProxySelector proxySelector) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
Authenticator |
getAuthenticator()
Returns the client's authenticator.
|
CertificatePinner |
getCertificatePinner()
Returns this address's certificate pinner, or null if this is not an HTTPS address.
|
List<ConnectionSpec> |
getConnectionSpecs() |
Dns |
getDns()
Returns the service that will be used to resolve IP addresses for hostnames.
|
HostnameVerifier |
getHostnameVerifier()
Returns the hostname verifier, or null if this is not an HTTPS address.
|
List<Protocol> |
getProtocols()
Returns the protocols the client supports.
|
Proxy |
getProxy()
Returns this address's explicitly-specified HTTP proxy, or null to
delegate to the proxy selector.
|
ProxySelector |
getProxySelector()
Returns this address's proxy selector.
|
SocketFactory |
getSocketFactory()
Returns the socket factory for new connections.
|
SSLSocketFactory |
getSslSocketFactory()
Returns the SSL socket factory, or null if this is not an HTTPS address.
|
String |
getUriHost()
Deprecated.
prefer
address.url().host() . |
int |
getUriPort()
Deprecated.
prefer
address.url().port() . |
int |
hashCode() |
HttpUrl |
url()
Returns a URL with the hostname and port of the origin server.
|
public Address(String uriHost, int uriPort, Dns dns, SocketFactory socketFactory, SSLSocketFactory sslSocketFactory, HostnameVerifier hostnameVerifier, CertificatePinner certificatePinner, Authenticator authenticator, Proxy proxy, List<Protocol> protocols, List<ConnectionSpec> connectionSpecs, ProxySelector proxySelector)
public HttpUrl url()
@Deprecated public String getUriHost()
address.url().host()
.@Deprecated public int getUriPort()
address.url().port()
.getPort()
accessors, this method never returns -1.public Dns getDns()
public SocketFactory getSocketFactory()
public Authenticator getAuthenticator()
public List<Protocol> getProtocols()
Protocol.HTTP_1_1
.public List<ConnectionSpec> getConnectionSpecs()
public ProxySelector getProxySelector()
public Proxy getProxy()
public SSLSocketFactory getSslSocketFactory()
public HostnameVerifier getHostnameVerifier()
public CertificatePinner getCertificatePinner()
Copyright © 2016. All Rights Reserved.