Interface PaginationList


public interface PaginationList
Represents an immutable iterable of Components, which can be sent to a Audience.

An instance of this class may be obtained using PaginationList.Builder.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builds a paginated output for an iterable of Components.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new PaginationList.Builder to build a pagination list.
    Gets the contents of this pagination list.
    Gets the footer to be displayed for this output on all pages after the contents and page navigation bar, if available.
    Gets the header to be displayed for this output on all pages after the title bar but before the contents, if available.
    int
    Gets the maximum amount of lines that will be sent per page.
    Gets the padding character to be used when centering headers and footers.
    default void
    sendTo(Iterable<Audience> receivers)
    Sends the first page of the constructed pagination list to all Audiences within an Iterable.
    default void
    sendTo(Iterable<Audience> receivers, int page)
    Sends the specified page of the constructed pagination list all Audiences within an Iterable.
    default void
    sendTo(Audience receiver)
    Sends the first page of the constructed pagination list to the specified message receiver.
    void
    sendTo(Audience receiver, int page)
    Send the specified page of the constructed pagination list to the specified message receiver.
    Gets the title text to be used in the title bar of this pagination.
  • Method Details

    • builder

      static PaginationList.Builder builder()
      Creates a new PaginationList.Builder to build a pagination list.
      Returns:
      The new builder
    • contents

      Iterable<Component> contents()
      Gets the contents of this pagination list.
      Returns:
      The contents of this pagination list
    • title

      Gets the title text to be used in the title bar of this pagination.
      Returns:
      The title text
    • header

      Optional<Component> header()
      Gets the header to be displayed for this output on all pages after the title bar but before the contents, if available.

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

      Returns:
      The header to be displayed
    • footer

      Optional<Component> footer()
      Gets the footer to be displayed for this output on all pages after the contents and page navigation bar, if available.
      Returns:
      The footer
    • padding

      Component padding()
      Gets the padding character to be used when centering headers and footers.
      Returns:
      The padding character
    • linesPerPage

      int linesPerPage()
      Gets the maximum amount of lines that will be sent 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.

      Returns:
      The maximum amount of lines that will be sent per page
    • sendTo

      default void sendTo(Audience receiver)
      Sends the first page of the constructed pagination list to the specified message receiver.
      Parameters:
      receiver - The receiver to send the first page to
      See Also:
    • sendTo

      void sendTo(Audience receiver, int page)
      Send the specified page of the constructed pagination list to the specified message receiver.

      A page that is out of bounds will result in a friendly error message being sent to the receiver.

      Pages start at an index of 1.

      Parameters:
      receiver - The receiver to send the page to
      page - The page to send, starting at an index of 1
    • sendTo

      default void sendTo(Iterable<Audience> receivers)
      Sends the first page of the constructed pagination list to all Audiences within an Iterable.
      Parameters:
      receivers - The message receivers to send the first page to
      See Also:
    • sendTo

      default void sendTo(Iterable<Audience> receivers, int page)
      Sends the specified page of the constructed pagination list all Audiences within an Iterable.
      Parameters:
      receivers - The message receivers to send the page to
      page - The page to send