org.apache.commons.httpclient

Class UsernamePasswordCredentials

Implemented Interfaces:
Credentials
Known Direct Subclasses:
NTCredentials

public class UsernamePasswordCredentials
extends java.lang.Object
implements Credentials

Username and password Credentials.
Version:
$Revision: 326707 $ $Date: 2005-10-19 16:51:46 -0400 (Wed, 19 Oct 2005) $
Authors:
Remy Maucherat
Sean C. Sullivan
Mike Bowler
Oleg Kalnichevski

Constructor Summary

UsernamePasswordCredentials()
Deprecated. Do not use.
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

boolean
equals(Object o)
These credentials are assumed equal if the username and password are the same.
String
getPassword()
Password property getter.
String
getUserName()
User name property getter.
int
hashCode()
Does a hash of both user name and password.
void
setPassword(String password)
Deprecated. Do not use.
void
setUserName(String userName)
Deprecated. Do not use.
String
toString()
Get this object string.

Constructor Details

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

UsernamePasswordCredentials

public UsernamePasswordCredentials(String userName,
                                   String password)
The constructor with the username and password arguments.
Parameters:
userName - the user name
password - the password

Method Details

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

getUserName

public String getUserName()
User name property getter.
Returns:
the userName

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 -

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 -

toString

public String toString()
Get this object string.
Returns:
the username:password formed string

Copyright (c) 1999-2005 - Apache Software Foundation