org.apache.http.auth
Class UsernamePasswordCredentials

java.lang.Object
  extended by org.apache.http.auth.UsernamePasswordCredentials
All Implemented Interfaces:
Credentials

public class UsernamePasswordCredentials
extends java.lang.Object
implements Credentials

Username and password Credentials.

Version:
$Revision: 537144 $ $Date: 2007-05-11 11:30:13 +0200 (Fri, 11 May 2007) $
Author:
Remy Maucherat, Sean C. Sullivan, Mike Bowler, Oleg Kalnichevski

Constructor Summary
UsernamePasswordCredentials(java.lang.String usernamePassword)
          The constructor with the username and password combined string argument.
UsernamePasswordCredentials(java.lang.String userName, java.lang.String password)
          The constructor with the username and password arguments.
 
Method Summary
 boolean equals(java.lang.Object o)
          These credentials are assumed equal if the username and password are the same.
 java.lang.String getPassword()
          Password property getter.
 java.lang.String getPrincipalName()
          User name property getter.
 int hashCode()
          Does a hash of both user name and password.
 java.lang.String toString()
          Get this object string.
 java.lang.String toText()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UsernamePasswordCredentials

public UsernamePasswordCredentials(java.lang.String usernamePassword)
The constructor with the username and password combined string argument.

Parameters:
usernamePassword - the username:password formed string
See Also:
toString()

UsernamePasswordCredentials

public UsernamePasswordCredentials(java.lang.String userName,
                                   java.lang.String password)
The constructor with the username and password arguments.

Parameters:
userName - the user name
password - the password
Method Detail

getPrincipalName

public java.lang.String getPrincipalName()
User name property getter.

Specified by:
getPrincipalName in interface Credentials
Returns:
the userName

getPassword

public java.lang.String getPassword()
Password property getter.

Specified by:
getPassword in interface Credentials
Returns:
the password

toText

public java.lang.String toText()

toString

public java.lang.String toString()
Get this object string.

Overrides:
toString in class java.lang.Object
Returns:
the username:password formed string

hashCode

public int hashCode()
Does a hash of both user name and password.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code including user name and password.

equals

public boolean equals(java.lang.Object o)
These credentials are assumed equal if the username and password are the same.

Overrides:
equals in class java.lang.Object
Parameters:
o - The other object to compare with.
Returns:
true if the object is equivalent.


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.