Class CommentManagerImpl

    • Method Detail

      • setUserModel

        public void setUserModel​(@NotNull
                                 UserModel userModel)
      • findComment

        @Nullable
        public Comment findComment​(long commentId)
        Description copied from interface: CommentManager
        Find comment by comment Id
        Specified by:
        findComment in interface CommentManager
        Parameters:
        commentId - comment identifier
        Returns:
        found comment object or null
      • newComment

        @NotNull
        public Comment newComment​(long userId,
                                  String commentText)
        Description copied from interface: CommentManager
        Create new comment
        Specified by:
        newComment in interface CommentManager
        Parameters:
        userId - Id of user, -1 if not available
        commentText - comment
        Returns:
        created comment
      • newComment

        @NotNull
        public Comment newComment​(@Nullable
                                  SUser user,
                                  String commentText)
        Description copied from interface: CommentManager
        Creates new comment
        Specified by:
        newComment in interface CommentManager
        Parameters:
        user - user
        commentText - comment
        Returns:
        new comment
      • createComment

        @NotNull
        public Comment createComment​(long commentId,
                                     long userId,
                                     String comment,
                                     Date timestamp)
        Description copied from interface: CommentManager
        Used to create Comment object from existing data, for example loaded from SQL query. If brand new comment should be created, use newComment method
        Specified by:
        createComment in interface CommentManager
        Parameters:
        commentId - id of the comment to be created
        userId - Id of user, -1 if not available
        comment - comment text
        timestamp - when comment was created
        Returns:
        see above