Interface CommentReactionManager

All Known Implementing Classes:
DefaultCommentReactionManager

public interface CommentReactionManager
Since:
8.17
  • Method Details

    • create

      CommentReactionDTO create(long commentId, String emoticon, String userKey, Instant created)
      Creates a database record for the reaction made by the user with given key to the given comment and given emoji.
      Parameters:
      commentId - the ID of the comment
      emoticon - Unicode of the emoji
      userKey - the key of the user who reacted
      created - the timestamp of reaction
      Returns:
      the CommentReactionDTO object
    • findById

      CommentReactionDTO findById(long id)
      Returns the reaction with given ID.
      Parameters:
      id - the ID of the reaction
      Returns:
      the CommentReactionDTO object
    • delete

      void delete(long commentId, String emoticon, String userKey)
      Deletes the user reaction with given emoji to given comment.
      Parameters:
      commentId - the ID of the comment
      emoticon - Unicode of the emoji
      userKey - the key of the user performing the operation
    • findByCommentId

      Collection<CommentReactionDTO> findByCommentId(long commentId)
      Returns all the reactions for given comment.
      Parameters:
      commentId - the ID of the comment
      Returns:
      a collection of CommentReactionDTO
    • getReactionCount

      long getReactionCount(long commentId, String emoticon)
      Returns a number of users who reacted with given emoji to given comment.
      Parameters:
      commentId - the ID of the comment
      emoticon - Unicode of the emoji
      Returns:
      a number of users who reacted
    • findByCommentAndEmoticon

      Collection<CommentReactionDTO> findByCommentAndEmoticon(long commentId, String emoticon)
      Returns all reactions for given emoji and given comment.
      Parameters:
      commentId - the ID of the comment
      emoticon - Unicode of the emoji
      Returns:
      a collections of CommentReactionDTO
    • exists

      boolean exists(long commentId, String emoticon, String userKey)
      Determines if the user with given key already reacted with given emoji to given comment.
      Parameters:
      commentId - the ID of the comment
      emoticon - Unicode of the emoji
      userKey - the key of the user performing the operation
      Returns:
      true if the user reacted, or false otherwise
    • deleteAllByCommentId

      void deleteAllByCommentId(long commentId)
      Deletes all reactions associated with the comment with given ID.
      Parameters:
      commentId - the ID of the comment