org.apache.commons.httpclient

Class UsernamePasswordCredentials

public class UsernamePasswordCredentials extends Object implements Credentials

Username and password {@link Credentials}.

Version: $Revision: 326707 $ $Date: 2005-10-19 16:51:46 -0400 (Wed, 19 Oct 2005) $

Author: Remy Maucherat Sean C. Sullivan Mike Bowler Oleg Kalnichevski

Constructor Summary
UsernamePasswordCredentials()
Default constructor.
UsernamePasswordCredentials(String usernamePassword)
The constructor with the username and password combined string argument.
UsernamePasswordCredentials(String userName, String password)
The constructor with the username and password arguments.
Method Summary
booleanequals(Object o)
These credentials are assumed equal if the username and password are the same.
StringgetPassword()
Password property getter.
StringgetUserName()
User name property getter.
inthashCode()
Does a hash of both user name and password.
voidsetPassword(String password)
Password property setter.
voidsetUserName(String userName)
User name property setter.
StringtoString()
Get this object string.

Constructor Detail

UsernamePasswordCredentials

public UsernamePasswordCredentials()

Deprecated: Do not use. Null user name no longer allowed

Default constructor.

UsernamePasswordCredentials

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

Parameters: usernamePassword the username:password formed string

See Also: UsernamePasswordCredentials

UsernamePasswordCredentials

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

Parameters: userName the user name password the password

Method Detail

equals

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

Parameters: o The other object to compare with.

Returns: true if the object is equivalent.

getPassword

public String getPassword()
Password property getter.

Returns: the password

See Also: setPassword

getUserName

public String getUserName()
User name property getter.

Returns: the userName

See Also: setUserName

hashCode

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

Returns: The hash code including user name and password.

setPassword

public void setPassword(String password)

Deprecated: Do not use. The UsernamePasswordCredentials objects should be immutable

Password property setter.

Parameters: password

See Also:

setUserName

public void setUserName(String userName)

Deprecated: Do not use. The UsernamePasswordCredentials objects should be immutable

User name property setter. User name may not be null.

Parameters: userName

See Also:

toString

public String toString()
Get this object string.

Returns: the username:password formed string

Copyright (c) 1999-2005 - Apache Software Foundation