| java.lang.Object java.net.Proxy
Proxy | public class Proxy (Code) | | This class is about proxy setting. A proxy contains type ,
proxy host address information. There are three types of Proxy :
Direct type proxy
HTTP type proxy
SOCKS type proxy
A Proxy instance is immutable.
|
Inner Class :public enum Type | |
Field Summary | |
final public static Proxy | NO_PROXY Represents Proxy.Type.DIRECT type proxy setting. |
Method Summary | |
public SocketAddress | address() Gets the proxy address.
the proxy address for HTTP and SOCKS type proxy. | final public boolean | equals(Object obj)
Compare obj with current proxy. | final public int | hashCode() gets the hash code of Proxy . | public String | toString()
Representing string of the proxy. | public Proxy.Type | type() Gets the proxy type. |
NO_PROXY | final public static Proxy NO_PROXY(Code) | | Represents Proxy.Type.DIRECT type proxy setting. It tells
protocol handlers not to use any proxy.
|
Proxy | public Proxy(Proxy.Type type, SocketAddress sa)(Code) | | New a 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.
Parameters: type - proxy type Parameters: sa - proxy address throws: IllegalArgumentException - when type is Proxy.Type.DIRECT or SocketAddress is null. |
address | public SocketAddress address()(Code) | | Gets the proxy address.
the proxy address for HTTP and SOCKS type proxy. Returns null for DIRECT type proxy. |
equals | final public boolean equals(Object obj)(Code) | |
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.
See Also: java.lang.Object.equals(java.lang.Object) true if obj represents the same proxy. Otherwise,returns false. |
|
|