Class PasswordCredential
- java.lang.Object
-
- nl.esciencecenter.xenon.credentials.PasswordCredential
-
- All Implemented Interfaces:
Credential,UserCredential
- Direct Known Subclasses:
CertificateCredential
public class PasswordCredential extends java.lang.Object implements UserCredential
A Credential consisting of a username + password combination.
-
-
Constructor Summary
Constructors Constructor Description PasswordCredential(java.lang.String username, char[] password)Create a new PasswordCredential using a char array as password.PasswordCredential(java.lang.String username, java.lang.String password)Create a new PasswordCredential using a String as password.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)char[]getPassword()Gets the password.java.lang.StringgetUsername()Returns the user name associated with this credential.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
PasswordCredential
public PasswordCredential(java.lang.String username, java.lang.String password)Create a new PasswordCredential using a String as password. This String will immediately be converted into a char array internally.- Parameters:
username- the user name of the credential.password- the password of the credential.
-
PasswordCredential
public PasswordCredential(java.lang.String username, char[] password)Create a new PasswordCredential using a char array as password.- Parameters:
username- the user name of the credential.password- the password of the credential.
-
-
Method Detail
-
getPassword
public char[] getPassword()
Gets the password.- Returns:
- the password
-
getUsername
public java.lang.String getUsername()
Description copied from interface:UserCredentialReturns the user name associated with this credential.- Specified by:
getUsernamein interfaceUserCredential- Returns:
- the user name associated with this credential.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-