public class UserPrincipal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable
| Constructor and Description |
|---|
UserPrincipal(java.lang.String name)
Create a UserPrincipal with a username.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Compares the specified Object with this
UserPrincipal
for equality. |
java.lang.String |
getName()
Return the username for this
UserPrincipal. |
int |
hashCode()
Return a hash code for this
UserPrincipal. |
java.lang.String |
toString()
Return a string representation of this
UserPrincipal. |
public UserPrincipal(java.lang.String name)
name - the username for this user.java.lang.NullPointerException - if the name
is null.public java.lang.String getName()
UserPrincipal.
getName in interface java.security.PrincipalUserPrincipalpublic java.lang.String toString()
UserPrincipal.
toString in interface java.security.PrincipaltoString in class java.lang.ObjectUserPrincipal.public boolean equals(java.lang.Object o)
UserPrincipal
for equality. Returns true if the given object is also a
UserPrincipal and the two UserPrincipals
have the same username.
equals in interface java.security.Principalequals in class java.lang.Objecto - Object to be compared for equality with this
UserPrincipal.UserPrincipal.public int hashCode()
UserPrincipal.
hashCode in interface java.security.PrincipalhashCode in class java.lang.ObjectUserPrincipal.