com.sun.grid.security.login
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.Principal
UserPrincipal
public java.lang.String toString()
UserPrincipal
.
toString
in interface java.security.Principal
toString
in class java.lang.Object
UserPrincipal
.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.Principal
equals
in class java.lang.Object
o
- Object to be compared for equality with this
UserPrincipal
.UserPrincipal
.public int hashCode()
UserPrincipal
.
hashCode
in interface java.security.Principal
hashCode
in class java.lang.Object
UserPrincipal
.