Modifier | Constructor and Description |
---|---|
protected |
Wiki.User(String username)
Creates a new user object.
|
Modifier and Type | Method and Description |
---|---|
Wiki.LogEntry[] |
blockLog()
Returns a log of the times when the user has been blocked.
|
Wiki.User |
clone()
Copies this user object.
|
Wiki.Revision[] |
contribs(int... ns)
Fetches the contributions for this user in a particular namespace(s).
|
int |
countEdits()
Fetches the internal edit count for this user, which includes all
live edits and deleted edits after (I think) January 2007.
|
boolean |
equals(Object x)
Tests whether this user is equal to another one.
|
HashMap<String,Object> |
getUserInfo()
Gets various properties of this user.
|
String |
getUsername()
Gets this user's username.
|
int |
hashCode()
Returns a hashcode of this user.
|
boolean |
isA(String group)
Returns true if the user is a member of the specified group.
|
boolean |
isAllowedTo(String right)
Returns true if the user is allowed to perform the specified action.
|
boolean |
isBlocked()
Determines whether this user is blocked by looking it up on the IP
block list.
|
String |
toString()
Returns a string representation of this user.
|
protected Wiki.User(String username)
username
- the username of the userpublic String getUsername()
public HashMap<String,Object> getUserInfo() throws IOException
{
"editcount" => 150000, // the user's edit count
(int)
"groups" => { "users", "autoconfirmed", "sysop" }, // the groups the user is in (String[])
"rights" => { "edit", "read", "block", "email"}, // the stuff the user can do (String[])
"emailable" => true, // whether the user can be emailed through
// [[Special:Emailuser]] or emailUser() (boolean)
"blocked" => false, // whether the user is blocked (boolean)
"gender" => Gender.MALE // the user's gender (Gender)
"created" => 20060101000000 // when the user account was created (Calendar)
}
IOException
- if a network error occurspublic boolean isAllowedTo(String right) throws IOException
right
- a specific actionIOException
- if a network error occurspublic boolean isA(String group) throws IOException
group
- a specific groupIOException
- if a network error occurspublic Wiki.LogEntry[] blockLog() throws IOException
IOException
- if something goes wrongpublic boolean isBlocked() throws IOException
IOException
- if we cannot retrieve the IP block listpublic int countEdits() throws IOException
IOException
- if a network error occurspublic Wiki.Revision[] contribs(int... ns) throws IOException
ns
- a list of namespaces to filter by, empty = all namespaces.IOException
public Wiki.User clone()
public boolean equals(Object x)
public String toString()
Copyright © 2013. All rights reserved.