Interface CommandHelp<T>

Type Parameters:
T - The help entry type. See CommandHelpWriter for more information.
All Superinterfaces:
Collection<T>, Iterable<T>, List<T>

public interface CommandHelp<T> extends List<T>
Represents an iterable of the entries generated by the CommandHelpWriter.

This class contains useful methods to allow paginating the help entries.

  • Method Details

    • paginate

      CommandHelp<T> paginate(int page, int elementsPerPage) throws InvalidHelpPageException
      Returns a CommandHelp that contains the help entries in a paginated manner
      Parameters:
      page - Page to include elements of
      elementsPerPage - The elements to include in each page
      Returns:
      The new command help
      Throws:
      InvalidHelpPageException
    • getPageSize

      @org.jetbrains.annotations.Range(from=1L, to=9223372036854775807L) int getPageSize(int elementsPerPage)
      Returns the number of pages that would be generated when including x elements per page.
      Parameters:
      elementsPerPage - Elements to include in each page. Must be at least 1
      Returns:
      The page size
      Throws:
      IllegalArgumentException - if elementsPerPage is less than 1.