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
SimpleCredentialsrepresentation based on a user name / password pair.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private char[]passwordprivate java.security.Principalprincipalprivate static longserialVersionUID
-
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 booleanequals(java.lang.Object o)char[]getPassword()Deprecated.UsegetUserPassword().java.lang.StringgetUserName()char[]getUserPassword()java.security.PrincipalgetUserPrincipal()inthashCode()java.lang.StringtoString()
-
-
-
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:
getUserPrincipalin interfaceCredentials
-
getUserName
public java.lang.String getUserName()
-
getUserPassword
public char[] getUserPassword()
- Since:
- 5.3
-
getPassword
@Deprecated public char[] getPassword()
Deprecated.UsegetUserPassword().- Specified by:
getPasswordin interfaceCredentials
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-