Package org.apache.hc.client5.http.auth
Class UsernamePasswordCredentials
java.lang.Object
org.apache.hc.client5.http.auth.UsernamePasswordCredentials
- All Implemented Interfaces:
Serializable
,Credentials
@Contract(threading=IMMUTABLE)
public class UsernamePasswordCredentials
extends Object
implements Credentials, Serializable
Simple
Credentials
representation based on a user name / password
pair.- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final char[]
private final Principal
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionUsernamePasswordCredentials
(String username, char[] password) The constructor with the username and password arguments.UsernamePasswordCredentials
(Principal principal, char[] password) The constructor with the username and password arguments. -
Method Summary
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
principal
-
password
private final char[] password
-
-
Constructor Details
-
UsernamePasswordCredentials
The constructor with the username and password arguments.- Parameters:
principal
- the user principalpassword
- the password- Since:
- 5.3
- See Also:
-
UsernamePasswordCredentials
The constructor with the username and password arguments.- Parameters:
username
- the user namepassword
- the password
-
-
Method Details
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfaceCredentials
-
getUserName
-
getUserPassword
public char[] getUserPassword()- Since:
- 5.3
-
getPassword
Deprecated.UsegetUserPassword()
.- Specified by:
getPassword
in interfaceCredentials
-
hashCode
public int hashCode() -
equals
-
toString
-
getUserPassword()
.