Class CommentEntity
- java.lang.Object
-
- org.silverpeas.core.webapi.comment.CommentEntity
-
- All Implemented Interfaces:
Serializable,WebEntity
public class CommentEntity extends Object implements WebEntity
The comment entity is a comment object that is exposed in the web as an entity (web entity). As such, it publishes only some of its attributes It represents a comment in Silverpeas plus some additional information such as the URI for accessing it.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommentEntity()protectedCommentEntity(Comment comment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static CommentEntityfromComment(Comment comment)Creates a new comment entity from the specified comment.UserProfileEntitygetAuthor()Gets the user that has written this comment.StringgetComponentId()Gets the identifier of the Silverpeas component instance to which the commented content belongs.StringgetCreationDate()Gets the date at which the comment was created.StringgetCurrentUserLanguage()Gets the current user language.StringgetId()Gets the unique identifier of the comment.StringgetModificationDate()Gets the date at which the comment was lastly updated.StringgetResourceId()Gets the identifier of the resource that is commented by this.StringgetResourceType()Gets the type of the resource that is commented by this.StringgetText()Gets the text of the comment.URIgetURI()Gets the URI of this comment entity.inthashCode()booleanisIndexed()Is this comment indexed?CommenttoComment()Gets the comment business objet this entity represent.CommentEntitywithCurrentUserLanguage(String currentUserLanguage)Sets a currentUserLanguage to this entity.CommentEntitywithURI(URI uri)Sets a URI to this entity.
-
-
-
Constructor Detail
-
CommentEntity
protected CommentEntity(Comment comment)
-
CommentEntity
protected CommentEntity()
-
-
Method Detail
-
fromComment
public static CommentEntity fromComment(Comment comment)
Creates a new comment entity from the specified comment.- Parameters:
comment- the comment to convert into a web entity.- Returns:
- the entity representing the specified comment.
-
toComment
public Comment toComment()
Gets the comment business objet this entity represent.- Returns:
- a comment instance.
-
withURI
public CommentEntity withURI(URI uri)
Sets a URI to this entity. With this URI, it can then be accessed through the Web.- Parameters:
uri- the web entity URI.- Returns:
- itself.
-
getURI
public URI getURI()
Gets the URI of this comment entity.
-
getId
public String getId()
Gets the unique identifier of the comment.- Returns:
- the comment identifier.
-
getComponentId
public String getComponentId()
Gets the identifier of the Silverpeas component instance to which the commented content belongs.- Returns:
- the silverpeas component instance identifier.
-
getResourceType
public String getResourceType()
Gets the type of the resource that is commented by this.- Returns:
- the commented resource type.
-
getResourceId
public String getResourceId()
Gets the identifier of the resource that is commented by this.- Returns:
- the commented resource identifier.
-
getAuthor
public UserProfileEntity getAuthor()
Gets the user that has written this comment.- Returns:
- the author of the comment.
-
getText
public String getText()
Gets the text of the comment.- Returns:
- the text of the comment.
-
getCurrentUserLanguage
public String getCurrentUserLanguage()
Gets the current user language.- Returns:
- the language of the current user.
-
withCurrentUserLanguage
public CommentEntity withCurrentUserLanguage(String currentUserLanguage)
Sets a currentUserLanguage to this entity.- Parameters:
currentUserLanguage- the language of the current user.- Returns:
- itself.
-
getCreationDate
public String getCreationDate()
Gets the date at which the comment was created.- Returns:
- the creation date of the comment.
-
getModificationDate
public String getModificationDate()
Gets the date at which the comment was lastly updated.- Returns:
- the modification date of the comment.
-
isIndexed
public boolean isIndexed()
Is this comment indexed? By default, the comment isn't indexed by the system.- Returns:
- true if the comment is indexed, false otherwise.
-
-