| java.lang.Object com.ecyrd.jspwiki.auth.WikiPrincipal
WikiPrincipal | final public class WikiPrincipal implements Principal(Code) | | A lightweight, immutable Principal class. WikiPrincipals can be created with
and optional "type" to denote what type of user profile Principal it represents
(FULL_NAME, WIKI_NAME, LOGIN_NAME). Types are used to determine suitable
user and login Principals in classes like WikiSession. However, the type
property of a WikiPrincipal does not affect a WikiPrincipal's logical equality
or hash code; two WikiPrincipals with the same name but different types are still
considered equal.
author: Janne Jalkanen author: Andrew Jaquith since: 2.2 |
Field Summary | |
final public static Comparator | COMPARATOR Static instance of Comparator that allows Principals to be sorted. | final public static String | FULL_NAME WikiPrincipal type denoting a user's full name. | final public static Principal | GUEST Represents an anonymous user. | final public static String | LOGIN_NAME WikiPrincipal type denoting a user's login name. | final public static String | UNSPECIFIED Generic WikiPrincipal of unspecified type. | final public static String | WIKI_NAME WikiPrincipal type denoting a user's wiki name. |
Method Summary | |
final public boolean | equals(Object obj) Two WikiPrincipal s are considered equal if their
names are equal (case-sensitive). | final public String | getName() Returns the wiki name of the Principal. | final public String | getType() | final public int | hashCode() The hashCode() returned for the WikiPrincipal is the same as
for its name. | final public String | toString() Returns a human-readable representation of the object. |
COMPARATOR | final public static Comparator COMPARATOR(Code) | | Static instance of Comparator that allows Principals to be sorted.
|
FULL_NAME | final public static String FULL_NAME(Code) | | WikiPrincipal type denoting a user's full name.
|
GUEST | final public static Principal GUEST(Code) | | Represents an anonymous user. WikiPrincipals may be
created with an optional type designator:
LOGIN_NAME, WIKI_NAME, FULL_NAME or UNSPECIFIED.
|
LOGIN_NAME | final public static String LOGIN_NAME(Code) | | WikiPrincipal type denoting a user's login name.
|
UNSPECIFIED | final public static String UNSPECIFIED(Code) | | Generic WikiPrincipal of unspecified type.
|
WIKI_NAME | final public static String WIKI_NAME(Code) | | WikiPrincipal type denoting a user's wiki name.
|
WikiPrincipal | public WikiPrincipal(String name)(Code) | | Constructs a new WikiPrincipal with a given name and a type of
WikiPrincipal.UNSPECIFIED .
Parameters: name - the name of the Principal |
equals | final public boolean equals(Object obj)(Code) | | Two WikiPrincipal s are considered equal if their
names are equal (case-sensitive).
Parameters: obj - the object to compare the result of the equality test |
getName | final public String getName()(Code) | | Returns the wiki name of the Principal.
the name |
hashCode | final public int hashCode()(Code) | | The hashCode() returned for the WikiPrincipal is the same as
for its name.
the hash code |
toString | final public String toString()(Code) | | Returns a human-readable representation of the object.
the string representation |
|
|