Interface PaginationList
-
public interface PaginationListRepresents an immutable iterable ofComponents, which can be sent to aAudience.An instance of this class may be obtained using
PaginationList.Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePaginationList.BuilderBuilds a paginated output for an iterable ofComponents.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static PaginationList.Builderbuilder()Creates a newPaginationList.Builderto build a pagination list.Iterable<Component>contents()Gets the contents of this pagination list.Optional<Component>footer()Gets the footer to be displayed for this output on all pages after the contents and page navigation bar, if available.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.intlinesPerPage()Gets the maximum amount of lines that will be sent per page.Componentpadding()Gets the padding character to be used when centering headers and footers.default voidsendTo(Iterable<Audience> receivers)default voidsendTo(Iterable<Audience> receivers, int page)default voidsendTo(Audience receiver)Sends the first page of the constructed pagination list to the specified message receiver.voidsendTo(Audience receiver, int page)Send the specified page of the constructed pagination list to the specified message receiver.Optional<Component>title()Gets the title text to be used in the title bar of this pagination.
-
-
-
Method Detail
-
builder
static PaginationList.Builder builder()
Creates a newPaginationList.Builderto 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
Optional<Component> 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:
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 topage- The page to send, starting at an index of 1
-
sendTo
default void sendTo(Iterable<Audience> receivers)
- Parameters:
receivers- The message receivers to send the first page to- See Also:
to send a specific page
-
-