org.ow2.jonas.lib.security.auth
Class JPrincipal

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

public class JPrincipal
extends Object
implements Principal, Serializable

Define a JOnAS principal

Author:
Florent Benoit
See Also:
Serialized Form

Constructor Summary
JPrincipal(String name)
          Constructor
 
Method Summary
 boolean equals(Object another)
          Compares this principal to the specified object.
 String getName()
          Returns the name of this principal.
 int hashCode()
          Returns a hashcode for this principal.
 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(String name)
Constructor

Parameters:
name - the name of this principal
Method Detail

equals

public boolean equals(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 Principal
Overrides:
equals in class 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 String toString()
Returns a string representation of this principal.

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

hashCode

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

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

getName

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

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


Copyright © 2010 OW2 Consortium. All Rights Reserved.