java.net
Class Proxy

java.lang.Object
  extended by java.net.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 class Proxy.Type
          Represents the proxy type.
 
Field Summary
static Proxy NO_PROXY
           
 
Constructor Summary
Proxy(Proxy.Type type, SocketAddress address)
          Creates a new Proxy object.
 
Method Summary
 SocketAddress address()
          Returns the socket address for this proxy object.
 boolean equals(Object obj)
          Compares the given object with this object.
 int hashCode()
          Returns the hashcode for this Proxy object.
 String toString()
          Returns a string representation of this Proxy object.
 Proxy.Type type()
          Returns the of this proxy instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

type

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

Returns:
the type
See Also:
Proxy.Type

equals

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

Overrides:
equals in class Object
Parameters:
obj - the Object to compare to
Returns:
true if both objects or equals, false otherwise.
See Also:
Object.hashCode()

hashCode

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

Overrides:
hashCode in class Object
Returns:
the hashcode
See Also:
Object.equals(Object), System.identityHashCode(Object)

toString

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

Overrides:
toString in class Object
Returns:
the string
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)