Class NewsfeedDetailsPresenter<T extends NewsfeedDetailsView>

    • Constructor Detail

      • NewsfeedDetailsPresenter

        public NewsfeedDetailsPresenter​(java.lang.String postId)
        Constructor of this presenter. Uses default query parameters to load data.
        Parameters:
        postId - id of Post
    • Method Detail

      • deleteComment

        public void deleteComment​(int commentId)
        Delete comment
        Parameters:
        commentId - id of comment
      • deleteComment

        public void deleteComment​(int commentId,
                                  NewsfeedParams queryParams)
        Delete comment
        Parameters:
        commentId - id of comment
        queryParams - custom NewsfeedParams to delete comment
      • deletePost

        public void deletePost()
        Delete post
      • deletePost

        public void deletePost​(NewsfeedParams queryParams)
        Delete post
        Parameters:
        queryParams - custom NewsfeedParams to delete post
      • likePost

        public void likePost()
        Like a post
      • likePost

        public void likePost​(NewsfeedParams queryParams)
        Like a post
        Parameters:
        queryParams - custom NewsfeedParams to like a post
      • unLikePost

        public void unLikePost()
        Unlike a post
      • unLikePost

        public void unLikePost​(NewsfeedParams queryParams)
        Unlike a post
        Parameters:
        queryParams - custom NewsfeedParams to unlike a post
      • likeComment

        public void likeComment​(int commentId)
        Like a comment
        Parameters:
        commentId - id of comment
      • likeComment

        public void likeComment​(int commentId,
                                NewsfeedParams queryParams)
        Like a comment
        Parameters:
        commentId - id of comment
        queryParams - custom NewsfeedParams to like a comment
      • unLikeComment

        public void unLikeComment​(int commentId)
        Unlike a comment
        Parameters:
        commentId - id of comment
      • unLikeComment

        public void unLikeComment​(int commentId,
                                  NewsfeedParams queryParams)
        Unlike a comment
        Parameters:
        commentId - id of comment
        queryParams - custom NewsfeedParams to unlike a comment
      • addComment

        public void addComment​(java.lang.String message)
        Add comment to the post
        Parameters:
        message - content of the comment
      • flagPost

        public void flagPost​(java.lang.String flag)
        Flags a post
        Parameters:
        flag - the selected flag
      • unflagPost

        public void unflagPost()
        Unflag a post
      • unflagPost

        public void unflagPost​(NewsfeedParams postParams)
        Unflag a post
        Parameters:
        postParams - custom NewsfeedParams to unflag a post
      • flagComment

        public void flagComment​(int commentId,
                                java.lang.String flag)
        Flag a comment
        Parameters:
        commentId - id of comment
        flag - selected flag
      • flagComment

        public void flagComment​(int commentId,
                                java.lang.String flag,
                                NewsfeedParams postParams,
                                NewsfeedFields flagParams)
        Flag a comment
        Parameters:
        commentId - id of comment
        flag - selected flag
        postParams - custom NewsfeedParams
        flagParams - custom NewsfeedFields
      • unflagComment

        public void unflagComment​(int commentId)
        Unflag comment
        Parameters:
        commentId - id of the comment to unflag
      • unflagComment

        public void unflagComment​(int commentId,
                                  NewsfeedParams postParams)
        Unflag a comment
        Parameters:
        commentId - id of the comment to unflag
        postParams - custom NewsfeedParams to unflag a comment
      • onLoadCommentsSuccess

        protected void onLoadCommentsSuccess​(Comments data)
        Called when GET comments is successful
        Parameters:
        data - Comment
      • onLoadCommentsFailed

        protected void onLoadCommentsFailed​(java.lang.String error)
        Called when GET comments fail
        Parameters:
        error - error message
      • onLoadFlagSuccess

        protected void onLoadFlagSuccess​(java.util.List<Flag> data)
        Called when GET flags is successful
        Parameters:
        data - list of Flag
      • onLoadFlagFailed

        protected void onLoadFlagFailed​(java.lang.String error)
        Called when GET flags fail
        Parameters:
        error - error message
      • onLoadPostSuccess

        protected void onLoadPostSuccess​(Post data)
        Called when GET post is successful
        Parameters:
        data - Post
      • onLoadPostFailed

        protected void onLoadPostFailed​(java.lang.String error)
        Called when GET post fails
        Parameters:
        error - error message
      • onLikePostSuccess

        protected void onLikePostSuccess()
        Called when liking a post is successful
      • onLikePostFailure

        protected void onLikePostFailure​(java.lang.String error)
        Called when liking a post fails
        Parameters:
        error - error message
      • onFlagPostSuccess

        protected void onFlagPostSuccess()
        Called when flagging a post is successful
      • onFlagPostFailure

        protected void onFlagPostFailure​(java.lang.String error)
        Called when flagging a post fails
        Parameters:
        error - error message
      • refreshPost

        public void refreshPost()
        Calls GET post API and clears the response cache
      • onDeletePostSuccess

        protected void onDeletePostSuccess​(Post post)
        Called when deleting a post is successful
        Parameters:
        post - deleted Post
      • onDeletePostFailure

        protected void onDeletePostFailure​(java.lang.String error)
        Called when deleting a post fails
        Parameters:
        error - error message
      • onAddCommentSuccess

        protected void onAddCommentSuccess()
        Called when adding a comment to a post is successful
      • onAddCommentFailure

        protected void onAddCommentFailure​(java.lang.String error)
        Called when adding a comment to a post fails
        Parameters:
        error - error message
      • onFlagCommentSuccess

        protected void onFlagCommentSuccess​(int commentId)
        Called when flagging a comment is successful
        Parameters:
        commentId - id of the flagged comment
      • onFlagCommentFailure

        protected void onFlagCommentFailure​(java.lang.String error,
                                            int commentId)
        Called when flagging a comment fails
        Parameters:
        error - error message
        commentId - id of the comment the user attempted to flag
      • onLikeCommentSuccess

        protected void onLikeCommentSuccess​(int commentId)
        Called when liking a comment is successful
        Parameters:
        commentId - id of the liked comment
      • onLikeCommentFailure

        protected void onLikeCommentFailure​(java.lang.String error,
                                            int commentId)
        Called when liking a comment fails
        Parameters:
        error - error message
        commentId - id of the comment the user attempted to like
      • onUnlikeCommentSuccess

        protected void onUnlikeCommentSuccess​(int commentId)
        Called when unliking a comment is successful
        Parameters:
        commentId - id of the liked comment
      • onUnlikeCommentFailure

        protected void onUnlikeCommentFailure​(java.lang.String error,
                                              int commentId)
        Called when unliking a comment fails
        Parameters:
        error - error message
        commentId - id of the comment the user attempted to unlike
      • refreshComment

        public void refreshComment​(int commentId)
        Calls GET comment API and clears response cache
        Parameters:
        commentId - id of the comment to GET
      • refreshComment

        public void refreshComment​(int commentId,
                                   NewsfeedParams queryParams)
        Calls GET comment API and clears response cache
        Parameters:
        commentId - id of the comment to GET
        queryParams - custom NewsfeedParams
      • onDeleteCommentSuccess

        protected void onDeleteCommentSuccess​(int commentId,
                                              DeletedComment deletedComment)
        Called when deleting a comment is successful
        Parameters:
        commentId - id of the comment
        deletedComment - DeletedComment
      • onDeleteCommentFailure

        protected void onDeleteCommentFailure​(java.lang.String error,
                                              int commentId)
        Called when delete a comment fails
        Parameters:
        error - error message
        commentId - id of the comment the user attempted to delete