|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.Proxy
public class Proxy
This class is about proxy setting. A proxy contains type,
proxy host address information. There are three types of Proxy:
Proxy instance is immutable.
| Nested Class Summary | |
|---|---|
static class |
Proxy.Type
The proxy type, includes DIRECT, HTTP and
SOCKS. |
| Field Summary | |
|---|---|
static Proxy |
NO_PROXY
Represents Proxy.Type.DIRECT type proxy setting. |
| Constructor Summary | |
|---|---|
Proxy(Proxy.Type type,
SocketAddress sa)
New a Proxy instance. |
|
| Method Summary | |
|---|---|
SocketAddress |
address()
Gets the proxy address. |
boolean |
equals(Object obj)
Compare obj with current proxy. |
int |
hashCode()
gets the hash code of Proxy. |
String |
toString()
Representing string of the proxy. |
Proxy.Type |
type()
Gets the proxy type. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Proxy NO_PROXY
Proxy.Type.DIRECT type proxy setting. It tells
protocol handlers not to use any proxy.
| Constructor Detail |
|---|
public Proxy(Proxy.Type type,
SocketAddress sa)
Proxy instance. SocketAddress must NOT be null when
type is either Proxy.Type.HTTP or
Proxy.Type.SOCKS. For Proxy.Type.DIRECT
type proxy, use Proxy.NO_PROXY directly instead of
constructing it.
type - proxy typesa - proxy address
IllegalArgumentException - when type is Proxy.Type.DIRECT
or SocketAddress is null.| Method Detail |
|---|
public Proxy.Type type()
public SocketAddress address()
HTTP and SOCKS
type proxy. Returns null for DIRECT type proxy.public String toString()
Representing string of the proxy. The string consists of
type.toString() and address.toString() if
type and address are not null.
toString in class ObjectObject.equals(java.lang.Object)public final boolean equals(Object obj)
Compare obj with current proxy. Returns false if the
obj is not a Proxy object. Returns true if
and only if the obj has the same address
and type value as current proxy.
equals in class Objectobj - Object the object to compare with this object.
obj represents the same proxy. Otherwise,
returns false.Object.equals(java.lang.Object)public final int hashCode()
Proxy.
hashCode in class ObjectProxy.Object.hashCode()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||