Class AuthorEntity
java.lang.Object
org.silverpeas.components.questionreply.web.AuthorEntity
- All Implemented Interfaces:
Serializable
The entity representing the author of a comment. It is a user that has written a comment and
that is exposed in the web as an entity (a web entity). As such, it publishes only some of its
attributes.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AuthorEntityfromUser(org.silverpeas.core.admin.user.model.UserDetail user) Creates a new comment author entity from the specified user.Gets the relative path of the user avatar.Gets the full name of the author (both the first name and the last name).getId()Gets the unique identifier of the author.Gets the preferred language of the author.final org.silverpeas.core.personalization.UserPreferencesGets the preference of this author.inthashCode()voidSets the URL at which is located the user's avatar.org.silverpeas.core.admin.user.model.UserDetailtoUser()Gets a user detail from this entity.
-
Constructor Details
-
AuthorEntity
protected AuthorEntity()Creates an empty comment author.
-
-
Method Details
-
fromUser
Creates a new comment author entity from the specified user.- Parameters:
user- the user to entitify.- Returns:
- the comment writer.
-
getAvatar
Gets the relative path of the user avatar.- Returns:
- the relative path of the URI referring the user avatar.
-
setAvatar
Sets the URL at which is located the user's avatar.- Parameters:
avatarURL- the URL of the user's avatar.
-
getId
Gets the unique identifier of the author.- Returns:
- the user identifier.
-
getFullName
Gets the full name of the author (both the first name and the last name).- Returns:
- the user full name.
-
getLanguage
Gets the preferred language of the author.- Returns:
- the language code of the author according to the ISO 639-1 standard (for example "fr" for french).
-
equals
-
hashCode
public int hashCode() -
toUser
public org.silverpeas.core.admin.user.model.UserDetail toUser()Gets a user detail from this entity.- Returns:
- a UserDetail instance.
-
getUserPreferences
public final org.silverpeas.core.personalization.UserPreferences getUserPreferences()Gets the preference of this author.- Returns:
- the preferences of the user or null if its preferences cannot be retrieved.
-