public class LoggedUser extends User
| Modifier and Type | Method and Description |
|---|---|
boolean |
canEdit()
Can this user be edited?
|
Stream<Post> |
posts()
Returns a Stream of every post created by the user in any Area.
|
List<Post> |
postsList()
Returns a list of the posts created by the user in any Area.
|
void |
set(String username,
String bio,
String avatar)
Changes the username, bio or avatar of the user.
|
void |
setAvatar(String avatar)
Sets this user's avatar.
|
void |
setBio(String bio)
Sets this user's bio.
|
void |
setUsername(String username)
Sets this user's name.
|
asLogged, avatar, avatarUrl, bio, cacheManager, equals, getID, hashCode, isBanned, name, toString, updateisNew, isValid, isValid, usepublic boolean canEdit()
UserThis method will always return false for a User, and will always return true for a
LoggedUser
canEdit in class Usertrue if the user's information can edited.Get this object as a LoggedUserpublic void setBio(String bio)
This method is a wrapper around set(String, String, String), see its documentation for more
information.
bio - the new biopublic void setUsername(String username)
This method is a wrapper around set(String, String, String), see its documentation for more
information.
username - the new user's namepublic void setAvatar(String avatar)
This method is a wrapper around set(String, String, String), see its documentation for more
information.
avatar - the new user's avatarpublic void set(String username, String bio, String avatar)
This method uses client-side prediction, which means that the changes will be reflected to the current object immediately, and the query will be sent to the server.
You can select which fields to update and which fields to keep by giving null to any unchanged field.
However, you cannot specify ONLY null values (the request to the server would be empty!)
username - the user's namebio - the user's bioavatar - the user's avatar (URL path)Set only the avatar,
Set only the bio,
Set only the usernamepublic Stream<Post> posts()
Get only the posts created in a specific Area.,
This method as a Listpublic List<Post> postsList()
For performance reasons, we strongly recommend using posts() to get a Stream, this method is provided
for the case in which you really need a Collection.
This method as a Stream, for better performances