Package org.apache.wiki.auth.login
Class PrincipalWrapper
java.lang.Object
org.apache.wiki.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
-
Constructor Summary
Constructors Constructor Description PrincipalWrapper(Principal principal)Constructs a new instance of this class by wrapping (decorating) the supplied principal. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)Two PrincipalWrapper objects are equal if their internally-wrapped principals are also equal.StringgetName()Returns the name of the wrapped principal.PrincipalgetPrincipal()Returns the wrapped Principal used to construct this instance.inthashCode()The hashcode is based on the hashcode of the wrapped principal.
-
Constructor Details
-
PrincipalWrapper
Constructs a new instance of this class by wrapping (decorating) the supplied principal.- Parameters:
principal- The principal to wrap
-
-
Method Details
-
getPrincipal
Returns the wrapped Principal used to construct this instance.- Returns:
- the wrapped Principal decorated by this instance.
-
getName
Returns the name of the wrapped principal. -
equals
Two PrincipalWrapper objects are equal if their internally-wrapped principals are also equal. -
hashCode
The hashcode is based on the hashcode of the wrapped principal.
-