org.jboss.security
Class AnybodyPrincipal

java.lang.Object
  extended by org.jboss.security.AnybodyPrincipal
All Implemented Interfaces:
Comparable, Principal

public class AnybodyPrincipal
extends Object
implements Comparable, Principal

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

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

Field Summary
static String ANYBODY
           
static AnybodyPrincipal ANYBODY_PRINCIPAL
           
 
Constructor Summary
AnybodyPrincipal()
           
 
Method Summary
 int compareTo(Object o)
          This method always returns 0 to indicate equality for any argument.
 boolean equals(Object another)
          This method always returns 0 to indicate equality for any argument.
 String getName()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANYBODY

public static final String ANYBODY
See Also:
Constant Field Values

ANYBODY_PRINCIPAL

public static final AnybodyPrincipal ANYBODY_PRINCIPAL
Constructor Detail

AnybodyPrincipal

public AnybodyPrincipal()
Method Detail

hashCode

public int hashCode()
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object

getName

public String getName()
Specified by:
getName in interface Principal
Returns:
""

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object

equals

public boolean equals(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 Principal
Overrides:
equals in class Object
Returns:
true to indicate equality for any argument.

compareTo

public int compareTo(Object o)
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:
compareTo in interface Comparable
Returns:
0 to indicate equality for any argument.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.