# Class NumericUserPrincipal

java.lang.Object
com.sun.grid.security.login.NumericUserPrincipal

All Implemented Interfaces:
  `Serializable, Principal`

public class NumericUserPrincipal extends Object implements Principal, Serializable

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`NumericUserPrincipal(long name)`
Create a `NumericUserPrincipal` using a long representation of the user's identification number (UID).
`NumericUserPrincipal(String name)`
Create a `NumericUserPrincipal` using a `String` representation of the user's identification number (UID).

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
Compares the specified Object with this `NumericUserPrincipal` for equality.
`String`
`getName()`
Return the user identification number (UID) for this `NumericUserPrincipal`.
`int`
`hashCode()`
Return a hash code for this `NumericUserPrincipal`.
`long`
`longValue()`
Return the user identification number (UID) for this `NumericUserPrincipal` as a long.
`String`
`toString()`
Return a string representation of this `NumericUserPrincipal`.

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface Principal

`implies`

## Constructor Details

### NumericUserPrincipal

public NumericUserPrincipal(String name)
Create a `NumericUserPrincipal` using a `String` representation of the user's identification number (UID).

Parameters:
  `name` - the user identification number (UID) for this user.
Throws:
  `NullPointerException` - if the `name` is `null`.

### NumericUserPrincipal

public NumericUserPrincipal(long name)
Create a `NumericUserPrincipal` 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 Details

### getName

public String getName()
Return the user identification number (UID) for this `NumericUserPrincipal`.

Specified by:
  `getName` in interface `Principal`
Returns:
  the user identification number (UID) for this `NumericUserPrincipal`

### longValue

public long longValue()
Return the user identification number (UID) for this `NumericUserPrincipal` as a long.

Returns:
  the user identification number (UID) for this `NumericUserPrincipal` as a long.

### toString

public String toString()
Return a string representation of this `NumericUserPrincipal`.

Specified by:
  `toString` in interface `Principal`
Overrides:
  `toString` in class `Object`
Returns:
  a string representation of this `NumericUserPrincipal`.

### equals

public boolean equals(Object o)
Compares the specified Object with this `NumericUserPrincipal` for equality. Returns true if the given object is also a `NumericUserPrincipal` and the two NumericUserPrincipals have the same user identification number (UID).

Specified by:
  `equals` in interface `Principal`
Overrides:
  `equals` in class `Object`
Parameters:
  `o` - Object to be compared for equality with this `NumericUserPrincipal`.
Returns:
  true if the specified Object is equal equal to this `NumericUserPrincipal`.

### hashCode

public int hashCode()
Return a hash code for this `NumericUserPrincipal`.

Specified by:
  `hashCode` in interface `Principal`
Overrides:
  `hashCode` in class `Object`
Returns:
  a hash code for this `NumericUserPrincipal`.