Package org.apache.http.auth
Class UsernamePasswordCredentials
- java.lang.Object
-
- org.apache.http.auth.UsernamePasswordCredentials
-
- All Implemented Interfaces:
java.io.Serializable
,Credentials
@Contract(threading=IMMUTABLE) public class UsernamePasswordCredentials extends java.lang.Object implements Credentials, java.io.Serializable
SimpleCredentials
implementation based on a user name / password pair.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UsernamePasswordCredentials(java.lang.String usernamePassword)
Deprecated.(4.5) will be replaced withString
,char[]
in 5.0UsernamePasswordCredentials(java.lang.String userName, java.lang.String password)
The constructor with the username and password arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getPassword()
java.lang.String
getUserName()
java.security.Principal
getUserPrincipal()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
UsernamePasswordCredentials
@Deprecated public UsernamePasswordCredentials(java.lang.String usernamePassword)
Deprecated.(4.5) will be replaced withString
,char[]
in 5.0The 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 namepassword
- the password
-
-
Method Detail
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interfaceCredentials
-
getUserName
public java.lang.String getUserName()
-
getPassword
public java.lang.String getPassword()
- Specified by:
getPassword
in interfaceCredentials
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-