org.objectweb.easybeans.security.struct
Class JPrincipal

java.lang.Object
  extended by org.objectweb.easybeans.security.struct.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

Implementation of Principal class.

Author:
Florent Benoit
See Also:
Serialized Form

Field Summary
private  java.lang.String name
          Name of this principal.
private static long serialVersionUID
          UID for serialization.
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
UID for serialization.

See Also:
Constant Field Values

name

private java.lang.String name
Name of this principal.

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.