Package org.glassfish.security.common
Class UserNameAndPassword
java.lang.Object
org.glassfish.security.common.UserNameAndPassword
- All Implemented Interfaces:
Serializable,Principal,UserPrincipal
Concrete implementation of
UserPrincipal with username and password.
- The password is not mandatory, it can be null.
- Two instances are equal if they have the same name and the same password.
- Author:
- David Matejcek
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserNameAndPassword(String name) UserNameAndPassword(String name, char[] password) UserNameAndPassword(String name, String password) -
Method Summary
-
Constructor Details
-
UserNameAndPassword
- Parameters:
name- non-null name
-
UserNameAndPassword
- Parameters:
name- non-null namepassword- can be null.
-
UserNameAndPassword
- Parameters:
name- non-null namepassword- can be null.
-
-
Method Details
-
getName
-
getStringPassword
- Returns:
- password as a string, can be null.
-
getPassword
public final char[] getPassword()- Returns:
- password as a string, can be null.
-
equals
- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classObject- Returns:
- true if the object is an instance of
UserNameAndPasswordand has the same name and the same password.
-
hashCode
public int hashCode() -
toString
-