Package org.apache.hc.client5.http.auth
Class UsernamePasswordCredentials
- java.lang.Object
-
- org.apache.hc.client5.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
representation based on a user name / password pair.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private char[]
password
private java.security.Principal
principal
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description UsernamePasswordCredentials(java.lang.String username, char[] password)
The constructor with the username and password arguments.UsernamePasswordCredentials(java.security.Principal principal, char[] password)
The constructor with the username and password arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
char[]
getPassword()
Deprecated.UsegetUserPassword()
.java.lang.String
getUserName()
char[]
getUserPassword()
java.security.Principal
getUserPrincipal()
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
principal
private final java.security.Principal principal
-
password
private final char[] password
-
-
Constructor Detail
-
UsernamePasswordCredentials
public UsernamePasswordCredentials(java.security.Principal principal, char[] password)
The constructor with the username and password arguments.- Parameters:
principal
- the user principalpassword
- the password- Since:
- 5.3
- See Also:
BasicUserPrincipal
,NTUserPrincipal
-
UsernamePasswordCredentials
public UsernamePasswordCredentials(java.lang.String username, char[] 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()
-
getUserPassword
public char[] getUserPassword()
- Since:
- 5.3
-
getPassword
@Deprecated public char[] getPassword()
Deprecated.UsegetUserPassword()
.- 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
-
-