Class Paginate


  • public class Paginate
    extends Object
    Used to paginate long lists of text, such as help, in chat.
    • Field Detail

      • PREVIOUS_PAGE

        public String PREVIOUS_PAGE
      • NO_PREVIOUS_PAGE

        public String NO_PREVIOUS_PAGE
      • NEXT_PAGE

        public String NEXT_PAGE
      • NO_NEXT_PAGE

        public String NO_NEXT_PAGE
    • Constructor Detail

      • Paginate

        public Paginate​(List<String> lines,
                        String header,
                        int linesPerPage,
                        String command)
        Generate pagination for when there is a long list of values to display in chat.
        Parameters:
        lines - The list of values to display across pages.
        header - The header to display at the top of every page.
        linesPerPage - How many lines to display on each page.
        command - The command, not including page number, to use for moving between pages.
    • Method Detail

      • getPage

        public String getPage()
      • getPage

        public String getPage​(int page)
      • getNextPage

        public String getNextPage()
      • getPreviousPage

        public String getPreviousPage()
      • getMaxPage

        public int getMaxPage()
      • createPage

        public String createPage​(List<String> lines,
                                 int pageNumber,
                                 String command)
        Create a new page of values. The page formatting is the same as the /help pages.
        Parameters:
        lines - The list of values for this page.
        pageNumber - The page number assigned to this page.
        command - The command, not including page number, to use for moving between pages.
        Returns:
        The created page ready to send formatted.
      • getConfigString

        public String getConfigString​(String path)