SPT Core API

com.sptci.auth
Class AbstractPrincipal

java.lang.Object
  extended by com.sptci.auth.AbstractPrincipal
All Implemented Interfaces:
Serializable, Principal
Direct Known Subclasses:
RolePrincipal, UserPrincipal

public abstract class AbstractPrincipal
extends Object
implements Serializable, Principal

An abstract Principal implementation.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: AbstractPrincipal.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-09-24
See Also:
Serialized Form

Field Summary
protected  String name
          The name of this principal instance.
 
Constructor Summary
protected AbstractPrincipal(String name)
          Create a new instance with the specified name.
 
Method Summary
 boolean equals(Object object)
          Compares this principal to the specified object.
 String getName()
          Return the name of this principal.
 int hashCode()
          Returns a hash code for this instance.
 String toString()
          Returns a string representation of this instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final String name
The name of this principal instance.

Constructor Detail

AbstractPrincipal

protected AbstractPrincipal(String name)
Create a new instance with the specified name.

Parameters:
name - The name value to set.
Method Detail

equals

public boolean equals(Object object)
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:
object - The object that is to be compared.
Returns:
Return 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 instance.

Specified by:
toString in interface Principal
Overrides:
toString in class Object
Returns:
The string representation. Returns name.

hashCode

public int hashCode()
Returns a hash code for this instance.

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
The hash code value for this instance.

getName

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

Specified by:
getName in interface Principal

SPT Core API