Package com.sun.grid.security.login
Class NumericUserPrincipal
- java.lang.Object
-
- com.sun.grid.security.login.NumericUserPrincipal
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Principal
public class NumericUserPrincipal extends java.lang.Object implements java.security.Principal, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NumericUserPrincipal(long name)
Create aNumericUserPrincipal
using a long representation of the user's identification number (UID).NumericUserPrincipal(java.lang.String name)
Create aNumericUserPrincipal
using aString
representation of the user's identification number (UID).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Compares the specified Object with thisNumericUserPrincipal
for equality.java.lang.String
getName()
Return the user identification number (UID) for thisNumericUserPrincipal
.int
hashCode()
Return a hash code for thisNumericUserPrincipal
.long
longValue()
Return the user identification number (UID) for thisNumericUserPrincipal
as a long.java.lang.String
toString()
Return a string representation of thisNumericUserPrincipal
.
-
-
-
Constructor Detail
-
NumericUserPrincipal
public NumericUserPrincipal(java.lang.String name)
Create aNumericUserPrincipal
using aString
representation of the user's identification number (UID).- Parameters:
name
- the user identification number (UID) for this user.- Throws:
java.lang.NullPointerException
- if thename
isnull
.
-
NumericUserPrincipal
public NumericUserPrincipal(long name)
Create aNumericUserPrincipal
using a long representation of the user's identification number (UID).- Parameters:
name
- the user identification number (UID) for this user represented as a long.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the user identification number (UID) for thisNumericUserPrincipal
.- Specified by:
getName
in interfacejava.security.Principal
- Returns:
- the user identification number (UID) for this
NumericUserPrincipal
-
longValue
public long longValue()
Return the user identification number (UID) for thisNumericUserPrincipal
as a long.- Returns:
- the user identification number (UID) for this
NumericUserPrincipal
as a long.
-
toString
public java.lang.String toString()
Return a string representation of thisNumericUserPrincipal
.- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
NumericUserPrincipal
.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisNumericUserPrincipal
for equality. Returns true if the given object is also aNumericUserPrincipal
and the two NumericUserPrincipals have the same user identification number (UID).- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Object to be compared for equality with thisNumericUserPrincipal
.- Returns:
- true if the specified Object is equal equal to this
NumericUserPrincipal
.
-
hashCode
public int hashCode()
Return a hash code for thisNumericUserPrincipal
.- Specified by:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this
NumericUserPrincipal
.
-
-