public final class WikiPrincipal extends java.lang.Object implements java.security.Principal, java.lang.Comparable<java.security.Principal>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<java.security.Principal> |
COMPARATOR
Static instance of Comparator that allows Principals to be sorted.
|
static java.lang.String |
FULL_NAME
WikiPrincipal type denoting a user's full name.
|
static java.security.Principal |
GUEST
Represents an anonymous user.
|
static java.lang.String |
LOGIN_NAME
WikiPrincipal type denoting a user's login name.
|
static java.lang.String |
UNSPECIFIED
Generic WikiPrincipal of unspecified type.
|
static java.lang.String |
WIKI_NAME
WikiPrincipal type denoting a user's wiki name.
|
| Constructor and Description |
|---|
WikiPrincipal(java.lang.String name)
Constructs a new WikiPrincipal with a given name and a type of
UNSPECIFIED. |
WikiPrincipal(java.lang.String name,
java.lang.String type)
Constructs a new WikiPrincipal with a given name and optional type designator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.security.Principal o)
Allows comparisons to any other Principal objects.
|
boolean |
equals(java.lang.Object obj)
Two
WikiPrincipals are considered equal if their names are equal (case-sensitive). |
java.lang.String |
getName()
Returns the wiki name of the Principal.
|
java.lang.String |
getType()
|
int |
hashCode()
The hashCode() returned for the WikiPrincipal is the same as for its name.
|
java.lang.String |
toString()
Returns a human-readable representation of the object.
|
public static final java.security.Principal GUEST
public static final java.lang.String FULL_NAME
public static final java.lang.String LOGIN_NAME
public static final java.lang.String WIKI_NAME
public static final java.lang.String UNSPECIFIED
public static final java.util.Comparator<java.security.Principal> COMPARATOR
public WikiPrincipal(java.lang.String name)
UNSPECIFIED.name - the name of the Principalpublic WikiPrincipal(java.lang.String name, java.lang.String type)
type parameter is not
LOGIN_NAME, FULL_NAME, WIKI_NAME or WIKI_NAME, this method throws
an IllegalArgumentException.name - the name of the Principaltype - the type for this principal, which may be LOGIN_NAME, FULL_NAME, WIKI_NAME or WIKI_NAME.public java.lang.String getName()
getName in interface java.security.Principalpublic boolean equals(java.lang.Object obj)
WikiPrincipals are considered equal if their names are equal (case-sensitive).equals in interface java.security.Principalequals in class java.lang.Objectobj - the object to comparepublic int hashCode()
hashCode in interface java.security.PrincipalhashCode in class java.lang.Objectpublic java.lang.String getType()
public java.lang.String toString()
toString in interface java.security.PrincipaltoString in class java.lang.Objectpublic int compareTo(java.security.Principal o)
PrincipalComparator.
compareTo in interface java.lang.Comparable<java.security.Principal>Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.