|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.auth.WikiPrincipal
public final class WikiPrincipal
A lightweight, immutable Principal class.
Nested Class Summary | |
---|---|
static class |
WikiPrincipal.PrincipalComparator
Tiny little class that compares objects of type Principal. |
Field Summary | |
---|---|
static Comparator |
COMPARATOR
|
static String |
FULL_NAME
|
static Principal |
GUEST
Represents an anonymous user. |
static String |
LOGIN_NAME
|
static String |
UNSPECIFIED
|
static String |
WIKI_NAME
|
Constructor Summary | |
---|---|
WikiPrincipal(String name)
Constructs a new WikiPrincipal with a given name and a type of UNSPECIFIED . |
|
WikiPrincipal(String name,
String type)
Constructs a new WikiPrincipal with a given name and optional type designator. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Two WikiPrincipal s are considered equal if their
names are equal (case-sensitive). |
String |
getName()
Returns the wiki name of the Principal. |
String |
getType()
Returns the Principal "type": LOGIN_NAME , FULL_NAME ,
WIKI_NAME or WIKI_NAME |
String |
toString()
Returns a human-readable representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.security.Principal |
---|
hashCode |
Field Detail |
---|
public static final Principal GUEST
public static final String FULL_NAME
public static final String LOGIN_NAME
public static final String WIKI_NAME
public static final String UNSPECIFIED
public static final Comparator COMPARATOR
Constructor Detail |
---|
public WikiPrincipal(String name)
UNSPECIFIED
.
name
- the name of the Principalpublic WikiPrincipal(String name, String type)
name
- the name of the Principaltype
- the type for this principal, which may be LOGIN_NAME
,
FULL_NAME
, WIKI_NAME
or WIKI_NAME
.
IllegalArgumentException
- if the type is not LOGIN_NAME
,
FULL_NAME
, WIKI_NAME
or WIKI_NAME
Method Detail |
---|
public final String getName()
getName
in interface Principal
public final boolean equals(Object obj)
WikiPrincipal
s are considered equal if their
names are equal (case-sensitive).
equals
in interface Principal
equals
in class Object
Object.equals(java.lang.Object)
public String getType()
LOGIN_NAME
, FULL_NAME
,
WIKI_NAME
or WIKI_NAME
public final String toString()
toString
in interface Principal
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |