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.SerializableGeneric 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 booleanequals(java.lang.Object o)Compares the specified Object with thisUserPrincipalfor equality.java.lang.StringgetName()Return the username for thisUserPrincipal.inthashCode()Return a hash code for thisUserPrincipal.java.lang.StringtoString()Return a string representation of thisUserPrincipal.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the username for thisUserPrincipal.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- the username for this
UserPrincipal
-
toString
public java.lang.String toString()
Return a string representation of thisUserPrincipal.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
UserPrincipal.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisUserPrincipalfor equality. Returns true if the given object is also aUserPrincipaland the two UserPrincipals have the same username.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin 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:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this
UserPrincipal.
-
-