Package org.gcube.portal.databook.shared
Class Comment
java.lang.Object
org.gcube.portal.databook.shared.Comment
- All Implemented Interfaces:
Serializable,Comparable<Comment>
Represents a comment associated with a feed or post.
Provides metadata such as user ID, text, timestamp, and edit status.
Implements Serializable for GWT and Java serialization.
- Version:
- 0.1 July 2012
- Author:
- Massimiliano Assante
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComment()Default constructor.Comment(String key, String userid, Date time, String feedid, String text, String fullName, String thumbnailURL) Constructs a Comment with the specified details.Comment(String key, String userid, Date time, String feedid, String text, String fullName, String thumbnailURL, boolean isEdit, Date editDate) Constructs a Comment for an edited comment with the specified details. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this comment to another comment based on their timestamps.Gets the ID of the feed associated with the comment.Gets the full name of the comment author.getKey()Gets the unique identifier of the comment.Gets the timestamp of the last edit.getText()Gets the text of the comment.Gets the thumbnail URL of the comment author.getTime()Gets the timestamp of the comment.Gets the user ID of the comment author.booleanisEdit()Checks if the comment has been edited.voidsetEdit(boolean isEdit) Sets the edit status of the comment.voidSets the ID of the feed associated with the comment.voidsetFullName(String fullName) Sets the full name of the comment author.voidSets the unique identifier of the comment.voidsetLastEditTime(Date lastEditTime) Sets the timestamp of the last edit.voidSets the text of the comment.voidsetThumbnailURL(String thumbnailURL) Sets the thumbnail URL of the comment author.voidSets the timestamp of the comment.voidSets the user ID of the comment author.toString()Returns a string representation of the comment.
-
Constructor Details
-
Comment
public Comment()Default constructor. -
Comment
public Comment(String key, String userid, Date time, String feedid, String text, String fullName, String thumbnailURL) Constructs a Comment with the specified details.- Parameters:
key- the unique identifier for the comment.userid- the user ID of the comment author.time- the timestamp of the comment.feedid- the ID of the feed associated with the comment.text- the text content of the comment.fullName- the full name of the comment author.thumbnailURL- the URL of the thumbnail image for the comment author.
-
Comment
public Comment(String key, String userid, Date time, String feedid, String text, String fullName, String thumbnailURL, boolean isEdit, Date editDate) Constructs a Comment for an edited comment with the specified details.- Parameters:
key- the unique identifier for the comment.userid- the user ID of the comment author.time- the timestamp of the comment.feedid- the ID of the feed associated with the comment.text- the text content of the comment.fullName- the full name of the comment author.thumbnailURL- the URL of the thumbnail image for the comment author.isEdit- whether the comment has been edited.editDate- the timestamp of the last edit.
-
-
Method Details
-
getText
Gets the text of the comment.- Returns:
- the text of the comment.
-
setText
Sets the text of the comment.- Parameters:
text- the text to set.
-
getKey
Gets the unique identifier of the comment.- Returns:
- the unique identifier of the comment.
-
setKey
Sets the unique identifier of the comment.- Parameters:
key- the unique identifier to set.
-
getUserid
Gets the user ID of the comment author.- Returns:
- the user ID of the comment author.
-
setUserid
Sets the user ID of the comment author.- Parameters:
userid- the user ID to set.
-
getTime
Gets the timestamp of the comment.- Returns:
- the timestamp of the comment.
-
setTime
Sets the timestamp of the comment.- Parameters:
time- the timestamp to set.
-
getFeedid
Gets the ID of the feed associated with the comment.- Returns:
- the ID of the feed associated with the comment.
-
setFeedid
Sets the ID of the feed associated with the comment.- Parameters:
feedid- the feed ID to set.
-
getFullName
Gets the full name of the comment author.- Returns:
- the full name of the comment author.
-
setFullName
Sets the full name of the comment author.- Parameters:
fullName- the full name to set.
-
getThumbnailURL
Gets the thumbnail URL of the comment author.- Returns:
- the thumbnail URL of the comment author.
-
setThumbnailURL
Sets the thumbnail URL of the comment author.- Parameters:
thumbnailURL- the thumbnail URL to set.
-
isEdit
public boolean isEdit()Checks if the comment has been edited.- Returns:
- true if the comment has been edited, false otherwise.
-
setEdit
public void setEdit(boolean isEdit) Sets the edit status of the comment.- Parameters:
isEdit- the edit status to set.
-
getLastEditTime
Gets the timestamp of the last edit.- Returns:
- the timestamp of the last edit.
-
setLastEditTime
Sets the timestamp of the last edit.- Parameters:
lastEditTime- the timestamp to set.
-
toString
Returns a string representation of the comment.
-