it.could.util.location
Class Location.Authority

java.lang.Object
  extended byit.could.util.location.Location.Authority
All Implemented Interfaces:
Encodable, EncodingAware
Enclosing class:
Location

public static class Location.Authority
extends Object
implements Encodable

The Authority class represents the autority and user information for a Location.

Author:
Pier Fumagalli

Field Summary
 
Fields inherited from interface it.could.util.encoding.EncodingAware
DEFAULT_ENCODING, PLATFORM_ENCODING
 
Method Summary
 boolean equals(Object object)
          Check if the specified Object is equal to this Authority instance.
 String getHost()
          Returns the decoded host name.
 String getHostInfo()
          Returns the host info part of the Authority.
 String getHostInfo(String encoding)
          Returns the host info part of the Authority using the specified character encoding.
 String getPassword()
          Returns the decoded password.
 int getPort()
          Returns the port number.
 String getUserInfo()
          Returns the "user info" field.
 String getUsername()
          Returns the decoded user name.
 int hashCode()
          Return the hash code value for this Authority instance.
 String toString()
          Return the URL-encoded String representation of this Authority instance.
 String toString(String encoding)
          Return the URL-encoded String representation of this Authority instance using the specified character encoding.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getUsername

public String getUsername()

Returns the decoded user name.


getPassword

public String getPassword()

Returns the decoded password.


getUserInfo

public String getUserInfo()

Returns the "user info" field.

This method will concatenate the username and password using the colon character and return a non-null String only if both of them are non-null.


getHost

public String getHost()

Returns the decoded host name.


getPort

public int getPort()

Returns the port number.


getHostInfo

public String getHostInfo()

Returns the host info part of the Authority.

This is the encoded representation of the user name optionally follwed by the colon (:) character and the encoded password.


getHostInfo

public String getHostInfo(String encoding)
                   throws UnsupportedEncodingException

Returns the host info part of the Authority using the specified character encoding.

This is the encoded representation of the user name optionally follwed by the colon (:) character and the encoded password.

Throws:
UnsupportedEncodingException

toString

public String toString()

Return the URL-encoded String representation of this Authority instance.

Specified by:
toString in interface Encodable

toString

public String toString(String encoding)
                throws UnsupportedEncodingException

Return the URL-encoded String representation of this Authority instance using the specified character encoding.

Specified by:
toString in interface Encodable
Throws:
UnsupportedEncodingException - if the specified encoding is not supported by the platform.

hashCode

public int hashCode()

Return the hash code value for this Authority instance.


equals

public boolean equals(Object object)

Check if the specified Object is equal to this Authority instance.

The specified Object is considered equal to this one if it is non-null, it is a Authority instance, and its host info equals this one's.