Package com.sun.grid.security.login

# Class NumericGroupPrincipal

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

All Implemented Interfaces:
  `Serializable`, `Principal`

public class NumericGroupPrincipal extends Object implements Principal, Serializable
`Prinicipal` indentifing a group users. The name of the group is the group id.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`NumericGroupPrincipal(long name, boolean primaryGroup)`
Create a `NumericGroupPrincipal` using a long representation of the user's group identification number (GID).
`NumericGroupPrincipal(String name, boolean primaryGroup)`
Create a `NumericGroupPrincipal` using a `String` representation of the user's group identification number (GID).

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
Compares the specified Object with this `NumericGroupPrincipal` for equality.
`String`
`getName()`
Return the user's group identification number (GID) for this `NumericGroupPrincipal`.
`int`
`hashCode()`
Return a hash code for this `NumericGroupPrincipal`.
`boolean`
`isPrimaryGroup()`
Return whether this group identification number (GID) represents the primary group to which this user belongs.
`long`
`longValue()`
Return the user's group identification number (GID) for this `NumericGroupPrincipal` as a long.
`String`
`toString()`
Return a string representation of this `NumericGroupPrincipal`.

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface java.security.Principal

`implies`

## Constructor Details

### NumericGroupPrincipal

public NumericGroupPrincipal(String name, boolean primaryGroup)
Create a `NumericGroupPrincipal` using a `String` representation of the user's group identification number (GID).

Parameters:
  `name` - the user's group identification number (GID) for this user.

  `primaryGroup` - true if the specified GID represents the primary group to which this user belongs.
Throws:
  `NullPointerException` - if the `name` is `null`.

### NumericGroupPrincipal

public NumericGroupPrincipal(long name, boolean primaryGroup)
Create a `NumericGroupPrincipal` using a long representation of the user's group identification number (GID).

Parameters:
  `name` - the user's group identification number (GID) for this user represented as a long.

  `primaryGroup` - true if the specified GID represents the primary group to which this user belongs.

## Method Details

### getName

public String getName()
Return the user's group identification number (GID) for this `NumericGroupPrincipal`.

Specified by:
  `getName` in interface `Principal`
Returns:
  the user's group identification number (GID) for this `NumericGroupPrincipal`

### longValue

public long longValue()
Return the user's group identification number (GID) for this `NumericGroupPrincipal` as a long.

Returns:
  the user's group identification number (GID) for this `NumericGroupPrincipal` as a long.

### isPrimaryGroup

public boolean isPrimaryGroup()
Return whether this group identification number (GID) represents the primary group to which this user belongs.

Returns:
  true if this group identification number (GID) represents the primary group to which this user belongs, or false otherwise.

### toString

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

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

### equals

public boolean equals(Object o)
Compares the specified Object with this `NumericGroupPrincipal` for equality. Returns true if the given object is also a `NumericGroupPrincipal` and the two NumericGroupPrincipals have the same group identification number (GID).

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

### hashCode

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

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