org.objectweb.jonas.security.auth
Class JPrincipal

java.lang.Object
  extended by org.objectweb.jonas.security.auth.JPrincipal
All Implemented Interfaces:
java.io.Serializable, java.security.Principal
Direct Known Subclasses:
JRole

public class JPrincipal
extends java.lang.Object
implements java.security.Principal, java.io.Serializable

Define a JOnAS principal

Author:
Florent Benoit
See Also:
Serialized Form

Constructor Summary
JPrincipal(java.lang.String name)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object another)
          Compares this principal to the specified object.
 java.lang.String getName()
          Returns the name of this principal.
 int hashCode()
          Returns a hashcode for this principal.
 java.lang.String toString()
          Returns a string representation of this principal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JPrincipal

public JPrincipal(java.lang.String name)
Constructor

Parameters:
name - the name of this principal
Method Detail

equals

public boolean equals(java.lang.Object another)
Compares this principal to the specified object. Returns true if the object passed in matches the principal represented by the implementation of this interface.

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object
Parameters:
another - principal to compare with.
Returns:
true if the principal passed in is the same as that encapsulated by this principal, and false otherwise.

toString

public java.lang.String toString()
Returns a string representation of this principal.

Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this principal.

hashCode

public int hashCode()
Returns a hashcode for this principal.

Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this principal.

getName

public java.lang.String getName()
Returns the name of this principal.

Specified by:
getName in interface java.security.Principal
Returns:
the name of this principal.