public final class WikiPrincipal extends Object implements Principal, Comparable<Principal>, Serializable
Modifier and Type | Field and Description |
---|---|
static Comparator<Principal> |
COMPARATOR
Static instance of Comparator that allows Principals to be sorted.
|
static String |
FULL_NAME
WikiPrincipal type denoting a user's full name.
|
static Principal |
GUEST
Represents an anonymous user.
|
static String |
LOGIN_NAME
WikiPrincipal type denoting a user's login name.
|
static String |
UNSPECIFIED
Generic WikiPrincipal of unspecified type.
|
static String |
WIKI_NAME
WikiPrincipal type denoting a user's wiki name.
|
Modifier | Constructor and Description |
---|---|
protected |
WikiPrincipal()
For serialization purposes
|
|
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.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Principal o)
Allows comparisons to any other Principal objects.
|
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()
|
int |
hashCode()
The hashCode() returned for the WikiPrincipal is the same as
for its name.
|
String |
toString()
Returns a human-readable representation of the object.
|
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<Principal> COMPARATOR
protected WikiPrincipal()
public WikiPrincipal(String name)
UNSPECIFIED
.name
- the name of the Principalpublic WikiPrincipal(String name, 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 boolean equals(Object obj)
WikiPrincipal
s are considered equal if their
names are equal (case-sensitive).public int hashCode()
public int compareTo(Principal o)
compareTo
in interface Comparable<Principal>
o
- Copyright © 2001-2018 The Apache Software Foundation. All rights reserved.