public class User extends Descriptor
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
avatar |
protected java.lang.String |
bio |
protected int |
ID |
protected boolean |
isBanned |
protected java.lang.String |
name |
| Modifier and Type | Method and Description |
|---|---|
LoggedUser |
asLogged()
This object, as a LoggedUser.
|
boolean |
canEdit()
Can this user be edited?
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAvatar()
The avatar of this user: the raw URL written in a String object, as specified by the server.
|
java.net.URL |
getAvatarUrl()
The avatar of this user: a URL object is created and points to the location of the avatar picture.
|
java.lang.String |
getBio()
The bio of this user.
|
int |
getID()
The ID of this user.
|
java.lang.String |
getName()
The name of this user.
|
int |
hashCode() |
boolean |
isBanned()
Is this user banned?
|
static User |
query(int id)
Retrieves a specific user by ID.
|
java.lang.String |
toString() |
void |
update()
Updates this Descriptor.
|
isNew, isValid, isValid, setTimeBeforeRemoval, useprotected final int ID
protected java.lang.String name
protected java.lang.String avatar
protected java.lang.String bio
protected boolean isBanned
public void update()
DescriptorThe update is always executed in the current thread.
update in class Descriptorpublic static User query(int id)
If the user is NOT cached, the method stalls and queries the server. If the user is cached, the method returns the cached user immediately. If the user is cached but has expired, the method immediately returns the expired version and launches a refresh job that will be executed concurrently.
You can know if the user you got is being refreshed or not by checking its Descriptor.isValid() method.
id - the ID of the userpublic boolean canEdit()
This method will always return false for a User, and will always return true for a
LoggedUser
true if the user's information can edited.Get this object as a LoggedUserpublic final LoggedUser asLogged() throws java.lang.ClassCastException
java.lang.ClassCastException - if this object cannot be converted to a LoggedUser.Can this object be converted to a LoggedUser?public int getID()
public java.lang.String getAvatar()
public java.net.URL getAvatarUrl()
public java.lang.String getBio()
public boolean isBanned()
true if this user is banned.public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object