java.net

Class Proxy

public class Proxy extends Object

Defines a proxy setting. This setting contains a type (https, socks, direct) and a socket address.

Since: 1.5

Nested Class Summary
static classProxy.Type
Represents the proxy type.
Field Summary
static ProxyNO_PROXY
Constructor Summary
Proxy(Proxy.Type type, SocketAddress address)
Creates a new Proxy object.
Method Summary
SocketAddressaddress()
Returns the socket address for this proxy object.
booleanequals(Object obj)
Compares the given object with this object.
inthashCode()
Returns the hashcode for this Proxy object.
StringtoString()
Returns a string representation of this Proxy object.
Proxy.Typetype()
Returns the of this proxy instance.

Field Detail

NO_PROXY

public static final Proxy NO_PROXY

Constructor Detail

Proxy

public Proxy(Proxy.Type type, SocketAddress address)
Creates a new Proxy object.

Parameters: type The type for this proxy address The address of this proxy

Method Detail

address

public SocketAddress address()
Returns the socket address for this proxy object.

Returns: the socket address

equals

public final boolean equals(Object obj)
Compares the given object with this object.

Returns: true if both objects or equals, false otherwise.

hashCode

public final int hashCode()
Returns the hashcode for this Proxy object.

Returns: the hashcode

toString

public String toString()
Returns a string representation of this Proxy object.

Returns: the string

type

public Proxy.Type type()
Returns the of this proxy instance.

Returns: the type

See Also: Type