Interface PaginationList

    • Nested Class Summary

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

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static PaginationList.Builder builder()
      Creates a new PaginationList.Builder to build a pagination list.
      java.lang.Iterable<Component> contents()
      Gets the contents of this pagination list.
      java.util.Optional<Component> footer()
      Gets the footer to be displayed for this output on all pages after the contents and page navigation bar, if available.
      java.util.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.
      int linesPerPage()
      Gets the maximum amount of lines that will be sent per page.
      Component padding()
      Gets the padding character to be used when centering headers and footers.
      default void sendTo​(java.lang.Iterable<Audience> receivers)
      Sends the first page of the constructed pagination list to all Audiences within an Iterable.
      default void sendTo​(java.lang.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.
      java.util.Optional<Component> title()
      Gets the title text to be used in the title bar of this pagination.
    • Method Detail

      • contents

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

        java.util.Optional<Component> title()
        Gets the title text to be used in the title bar of this pagination.
        Returns:
        The title text
      • header

        java.util.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

        java.util.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:
        to send a specific page
      • 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​(java.lang.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:
        to send a specific page
      • sendTo

        default void sendTo​(java.lang.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