Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.security
Class NobodyPrincipal

    java.lang.Object
      |
      +--org.jboss.security.NobodyPrincipal

All Implemented Interfaces:
  java.lang.Comparable, java.security.Principal

public class NobodyPrincipal
extends java.lang.Object
implements java.lang.Comparable, java.security.Principal

An implementation of Principal and Comparable that represents no role. Any Principal or name of a Principal when compared to an NobodyPrincipal using `equals` or `compareTo` will always be found not equal to the NobodyPrincipal. Note that this class is not likely to operate correctly in a collection since the hashCode() and equals() methods are not correlated.

Version:
  $Revision: 1.2.2.1 $
Author:
  Scott.Stark@jboss.org

Field Summary
`static java.lang.String` | `NOBODY`
`static NobodyPrincipal` | `NOBODY_PRINCIPAL`

Constructor Summary
`NobodyPrincipal()`

Method Summary
`int` | `compareTo(java.lang.Object o)` This method always returns 1 to indicate inequality for any argument.
`boolean` | `equals(java.lang.Object another)` This method always returns 0 to indicate equality for any argument.
`java.lang.String` | `getName()`
`int` | `hashCode()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### NOBODY

    public static final java.lang.String NOBODY

### NOBODY_PRINCIPAL

    public static final NobodyPrincipal NOBODY_PRINCIPAL

Constructor Detail

### NobodyPrincipal

    public NobodyPrincipal()

Method Detail

### hashCode

    public int hashCode()

  Specified by:
    `hashCode` in interface `java.security.Principal`
  Overrides:
    `hashCode` in class `java.lang.Object`

### getName

    public java.lang.String getName()

  Specified by:
    `getName` in interface `java.security.Principal`
  Returns:
    ""

### toString

    public java.lang.String toString()

  Specified by:
    `toString` in interface `java.security.Principal`
  Overrides:
    `toString` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object another)

  This method always returns 0 to indicate equality for any argument. This is only meaningful when comparing against other Principal objects or names of Principals.
  Specified by:
    `equals` in interface `java.security.Principal`
  Overrides:
    `equals` in class `java.lang.Object`
  Returns:
    false to indicate inequality for any argument.

### compareTo

    public int compareTo(java.lang.Object o)

  This method always returns 1 to indicate inequality for any argument. This is only meaningful when comparing against other Principal objects or names of Principals.
  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Returns:
    1 to indicate inequality for any argument.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 The JBoss Organization. All Rights Reserved.