Methods Summary |
---|
public final boolean | equals(java.lang.Object obj)Compares this scheme to an object.
if (obj == null) return false;
if (this == obj) return true;
if (!(obj instanceof Scheme)) return false;
Scheme s = (Scheme) obj;
return (name.equals(s.name) &&
defaultPort == s.defaultPort &&
layered == s.layered &&
socketFactory.equals(s.socketFactory)
);
|
public final int | getDefaultPort()Obtains the default port.
return defaultPort;
|
public final java.lang.String | getName()Obtains the scheme name.
return name;
|
public final org.apache.http.conn.scheme.SocketFactory | getSocketFactory()Obtains the socket factory.
If this scheme is {@link #isLayered layered}, the factory implements
{@link LayeredSocketFactory LayeredSocketFactory}.
return socketFactory;
|
public int | hashCode()Obtains a hash code for this scheme.
int hash = LangUtils.HASH_SEED;
hash = LangUtils.hashCode(hash, this.defaultPort);
hash = LangUtils.hashCode(hash, this.name);
hash = LangUtils.hashCode(hash, this.layered);
hash = LangUtils.hashCode(hash, this.socketFactory);
return hash;
|
public final boolean | isLayered()Indicates whether this scheme allows for layered connections.
return layered;
|
public final int | resolvePort(int port)Resolves the correct port for this scheme.
Returns the given port if it is valid, the default port otherwise.
return ((port <= 0) || (port > 0xffff)) ? defaultPort : port;
|
public final java.lang.String | toString()Return a string representation of this object.
if (stringRep == null) {
StringBuilder buffer = new StringBuilder();
buffer.append(this.name);
buffer.append(':");
buffer.append(Integer.toString(this.defaultPort));
stringRep = buffer.toString();
}
return stringRep;
|