com.ecyrd.jspwiki.auth.login
Class PrincipalWrapper

java.lang.Object
  extended by com.ecyrd.jspwiki.auth.login.PrincipalWrapper
All Implemented Interfaces:
Principal

public final class PrincipalWrapper
extends Object
implements Principal

Wrapper class for container-managed or externally-provided principals. Instances of PrincipalWrapper are immutable.

Since:
2.3
Version:
$Revision$ $Date$
Author:
Andrew Jaquith

Constructor Summary
PrincipalWrapper(Principal principal)
          Constructs a new instance of this class by wrapping (decorating) the supplied principal.
 
Method Summary
 boolean equals(Object obj)
          Two PrincipalWrapper objects are equal if their internally-wrapped principals are also equal.
 String getName()
          Returns the name of the wrapped principal.
 Principal getPrincipal()
          Returns the wrapped Principal used to construct this instance.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

PrincipalWrapper

public PrincipalWrapper(Principal principal)
Constructs a new instance of this class by wrapping (decorating) the supplied principal.

Parameters:
principal -
Method Detail

getPrincipal

public final Principal getPrincipal()
Returns the wrapped Principal used to construct this instance.

Returns:
the wrapped Principal decorated by this instance.

getName

public final String getName()
Returns the name of the wrapped principal.

Specified by:
getName in interface Principal

equals

public boolean equals(Object obj)
Two PrincipalWrapper objects are equal if their internally-wrapped principals are also equal.

Specified by:
equals in interface Principal
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object