Package org.jboss.security
Class NobodyPrincipal
- java.lang.Object
-
- org.jboss.security.NobodyPrincipal
-
- All Implemented Interfaces:
Comparable<Object>
,Principal
public class NobodyPrincipal extends Object implements Comparable<Object>, Principal
An implementation of Principal and Comparable that represents no role. Any Principal or name of a Principal when compared to an NobodyPrincipal usingequals
orcompareTo
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$
- Author:
- Scott.Stark@jboss.org
-
-
Field Summary
Fields Modifier and Type Field Description static String
NOBODY
static NobodyPrincipal
NOBODY_PRINCIPAL
-
Constructor Summary
Constructors Constructor Description NobodyPrincipal()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
This method always returns 1 to indicate inequality for any argument.boolean
equals(Object another)
This method always returns 0 to indicate equality for any argument.String
getName()
int
hashCode()
String
toString()
-
-
-
Field Detail
-
NOBODY
public static final String NOBODY
- See Also:
- Constant Field Values
-
NOBODY_PRINCIPAL
public static final NobodyPrincipal NOBODY_PRINCIPAL
-
-
Method Detail
-
hashCode
public int hashCode()
-
toString
public String toString()
-
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.
-
compareTo
public int compareTo(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 interfaceComparable<Object>
- Returns:
- 1 to indicate inequality for any argument.
-
-