Package 

Interface CommentList


  • 
    public interface CommentList
    
                        

    A class representing a paginated list of comments for a specific query.

    This interface provides methods to fetch and manage comments, including pagination support and real-time updates through WebSocket events. It maintains an observable state that automatically updates when comment-related events are received.

    val query = CommentsQuery()
    val commentList = feedsClient.commentList(query)
    
    // Fetch initial comment matching the query
    val comments = commentList.get()
    
    // Load more comments if available
    if (commentList.state.canLoadMore) {
        val moreComments = commentList.queryMoreComments()
    }
    
    // Observe state changes
    commentList.state.comments.collect { comments ->
        println("Updated comments: ${comments.size}")
    }
    • Method Summary

      Modifier and Type Method Description
      abstract Result<List<CommentData>> get() Fetches the first page comments based on the query.
      abstract Result<List<CommentData>> queryMoreComments(Integer limit) Fetches the next page of comments based on the current state.
      abstract CommentsQuery getQuery() The query used to fetch the comments.
      abstract CommentListState getState() An observable object representing the current state of the comment list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait