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 boolean
equals(java.lang.Object o)
char[]
getPassword()
Gets the password.java.lang.String
getUsername()
Returns the user name associated with this credential.int
hashCode()
java.lang.String
toString()
-
-
-
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:UserCredential
Returns the user name associated with this credential.- Specified by:
getUsername
in interfaceUserCredential
- Returns:
- the user name associated with this credential.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-