Package com.sun.grid.security.login
Class UserPrincipal
- java.lang.Object
-
- com.sun.grid.security.login.UserPrincipal
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Principal
public class UserPrincipal extends java.lang.Object implements java.security.Principal, java.io.Serializable
Generic principal for a logged in user.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UserPrincipal(java.lang.String name)
Create a UserPrincipal with a username.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Compares the specified Object with thisUserPrincipal
for equality.java.lang.String
getName()
Return the username for thisUserPrincipal
.int
hashCode()
Return a hash code for thisUserPrincipal
.java.lang.String
toString()
Return a string representation of thisUserPrincipal
.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the username for thisUserPrincipal
.- Specified by:
getName
in interfacejava.security.Principal
- Returns:
- the username for this
UserPrincipal
-
toString
public java.lang.String toString()
Return a string representation of thisUserPrincipal
.- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
UserPrincipal
.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisUserPrincipal
for equality. Returns true if the given object is also aUserPrincipal
and the two UserPrincipals have the same username.- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Object to be compared for equality with thisUserPrincipal
.- Returns:
- true if the specified Object is equal equal to this
UserPrincipal
.
-
hashCode
public int hashCode()
Return a hash code for thisUserPrincipal
.- Specified by:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this
UserPrincipal
.
-
-