public final class Proxy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Authentication |
auth |
private java.lang.String |
host |
private int |
port |
private java.lang.String |
type |
static java.lang.String |
TYPE_HTTP
Type denoting a proxy for HTTP transfers.
|
static java.lang.String |
TYPE_HTTPS
Type denoting a proxy for HTTPS transfers.
|
Constructor and Description |
---|
Proxy(java.lang.String type,
java.lang.String host,
int port)
Creates a new proxy with the specified properties and no authentication.
|
Proxy(java.lang.String type,
java.lang.String host,
int port,
Authentication auth)
Creates a new proxy with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
private static <T> boolean |
eq(T s1,
T s2) |
boolean |
equals(java.lang.Object obj) |
Authentication |
getAuthentication()
Gets the authentication to use for the proxy connection.
|
java.lang.String |
getHost()
Gets the host for this proxy.
|
int |
getPort()
Gets the port number for this proxy.
|
java.lang.String |
getType()
Gets the type of this proxy.
|
private static int |
hash(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
public static final java.lang.String TYPE_HTTP
public static final java.lang.String TYPE_HTTPS
private final java.lang.String type
private final java.lang.String host
private final int port
private final Authentication auth
public Proxy(java.lang.String type, java.lang.String host, int port)
type
- The type of the proxy, e.g. "http", may be null
.host
- The host of the proxy, may be null
.port
- The port of the proxy.public Proxy(java.lang.String type, java.lang.String host, int port, Authentication auth)
type
- The type of the proxy, e.g. "http", may be null
.host
- The host of the proxy, may be null
.port
- The port of the proxy.auth
- The authentication to use for the proxy connection, may be null
.public java.lang.String getType()
null
.public java.lang.String getHost()
null
.public int getPort()
public Authentication getAuthentication()
null
if none.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
private static <T> boolean eq(T s1, T s2)
public int hashCode()
hashCode
in class java.lang.Object
private static int hash(java.lang.Object obj)