Interface PaginationList.Builder

All Superinterfaces:
AbstractBuilder<PaginationList>, Builder<PaginationList,PaginationList.Builder>, CopyableBuilder<PaginationList,PaginationList.Builder>, ResettableBuilder<PaginationList,PaginationList.Builder>
Enclosing interface:
PaginationList

public static interface PaginationList.Builder extends Builder<PaginationList,PaginationList.Builder>, CopyableBuilder<PaginationList,PaginationList.Builder>
Builds a paginated output for an iterable of Components.
  • Method Details

    • contents

      Sets the contents of this output as an iterable.

      If this Iterable is a List, bidirectional navigation is supported. Otherwise, only going to the next page will be supported.

      Parameters:
      contents - The contents to output
      Returns:
      This builder
    • contents

      PaginationList.Builder contents(Component... contents)
      Sets the contents of this output to be the given array of contents.
      Parameters:
      contents - The contents to output
      Returns:
      This builder
    • title

      PaginationList.Builder title(@Nullable Component title)
      Sets the title text to be used in the title bar of this pagination.

      This should be less than one line long.

      Parameters:
      title - The title to use
      Returns:
      This builder
    • header

      PaginationList.Builder header(@Nullable Component header)
      Sets the header to be displayed for this output on all pages after the title bar but before the contents.

      The header and footer will use this Text's style and color for formatting.

      If the header is not specified, or passed in as null, it will be omitted when displaying the list.

      Parameters:
      header - The header to set
      Returns:
      This builder
    • footer

      PaginationList.Builder footer(@Nullable Component footer)
      Sets the footer to be displayed for this output on all pages after the contents and page navigation bar.

      If the footer is not specified, or passed in as null, it will be omitted when displaying the list.

      Parameters:
      footer - The footer to set
      Returns:
      This builder
    • padding

      Sets the padding character to be used when centering headers and footers.
      Parameters:
      padding - The padding to use
      Returns:
      This builder
    • linesPerPage

      PaginationList.Builder linesPerPage(int linesPerPage)
      Sets the maximum number of lines that can be displayed per page.

      This defaults to the maximum amount of lines that can be displayed on a source's screen at one time if not specified.

      Parameters:
      linesPerPage - The maximum number of lines to display per page
      Returns:
      This builder
    • build

      Creates a PaginationList from this pagination builder.
      Specified by:
      build in interface AbstractBuilder<PaginationList>
      Returns:
      The pagination list
      Throws:
      IllegalStateException - If no contents were specified
    • sendTo

      default PaginationList sendTo(Audience receiver)
      Sends the constructed pagination list to the given receiver.
      Parameters:
      receiver - The receiver to send the list to
      Returns:
      The constructed pagination list
    • sendTo

      default PaginationList sendTo(Iterable<Audience> receivers)
      Sends the constructed pagination list to all Audiences within an Iterable.
      Parameters:
      receivers - The message receivers to send the list to
      Returns:
      The constructed pagination list