Class Comment

java.lang.Object
org.gcube.portal.databook.shared.Comment
All Implemented Interfaces:
Serializable, Comparable<Comment>

public class Comment extends Object implements 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 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

      public String getText()
      Gets the text of the comment.
      Returns:
      the text of the comment.
    • setText

      public void setText(String text)
      Sets the text of the comment.
      Parameters:
      text - the text to set.
    • getKey

      public String getKey()
      Gets the unique identifier of the comment.
      Returns:
      the unique identifier of the comment.
    • setKey

      public void setKey(String key)
      Sets the unique identifier of the comment.
      Parameters:
      key - the unique identifier to set.
    • getUserid

      public String getUserid()
      Gets the user ID of the comment author.
      Returns:
      the user ID of the comment author.
    • setUserid

      public void setUserid(String userid)
      Sets the user ID of the comment author.
      Parameters:
      userid - the user ID to set.
    • getTime

      public Date getTime()
      Gets the timestamp of the comment.
      Returns:
      the timestamp of the comment.
    • setTime

      public void setTime(Date time)
      Sets the timestamp of the comment.
      Parameters:
      time - the timestamp to set.
    • getFeedid

      public String getFeedid()
      Gets the ID of the feed associated with the comment.
      Returns:
      the ID of the feed associated with the comment.
    • setFeedid

      public void setFeedid(String feedid)
      Sets the ID of the feed associated with the comment.
      Parameters:
      feedid - the feed ID to set.
    • getFullName

      public String getFullName()
      Gets the full name of the comment author.
      Returns:
      the full name of the comment author.
    • setFullName

      public void setFullName(String fullName)
      Sets the full name of the comment author.
      Parameters:
      fullName - the full name to set.
    • getThumbnailURL

      public String getThumbnailURL()
      Gets the thumbnail URL of the comment author.
      Returns:
      the thumbnail URL of the comment author.
    • setThumbnailURL

      public void setThumbnailURL(String thumbnailURL)
      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

      public Date getLastEditTime()
      Gets the timestamp of the last edit.
      Returns:
      the timestamp of the last edit.
    • setLastEditTime

      public void setLastEditTime(Date lastEditTime)
      Sets the timestamp of the last edit.
      Parameters:
      lastEditTime - the timestamp to set.
    • compareTo

      public int compareTo(Comment toCompare)
      Compares this comment to another comment based on their timestamps.
      Specified by:
      compareTo in interface Comparable<Comment>
      Parameters:
      toCompare - the comment to compare to.
      Returns:
      1 if this comment is newer, -1 if older, 0 if they are equal.
    • toString

      public String toString()
      Returns a string representation of the comment.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the comment.