Interface IPageBag
- All Known Implementing Classes:
ListPageBag, PageBag, PrivateListPageBag, PrivatePageBag
public interface IPageBag
-
Method Summary
Modifier and TypeMethodDescriptiondefault MessageEditDataBuild an embed for an empty page when the bag is emptyBuild the embed for the page.default List<PageButton> buttons()Get additional buttons which should be added to the pagedefault booleancanInteract(User user) Defines if a user can interact with this page or not.intcurrent()Get the current index of the page.voidcurrent(int page) Set the current index of the page.booleanhasNext()Checks if there is a next pagebooleanChecks if there is a previous pagedefault booleanisEmpty()Checks if the page count is 0.static <T> IPageBaglist(List<T> pages, Function<ListPageBag<T>, MessageEditData> embed) static <T> IPageBaglist(List<T> pages, Function<ListPageBag<T>, MessageEditData> embed, Function<ListPageBag<T>, MessageEditData> empty) intpages()The amount of pages.voidGoes to the next page indexvoidGoes to the previous page indexstatic IPageBagstandard(int pages, Function<IPageBag, MessageEditData> embed, Function<IPageBag, MessageEditData> empty) static IPageBagstandard(int pages, Supplier<MessageEditData> embed)
-
Method Details
-
standard
-
standard
static IPageBag standard(int pages, Function<IPageBag, MessageEditData> embed, Function<IPageBag, MessageEditData> empty) -
list
-
list
static <T> IPageBag list(List<T> pages, Function<ListPageBag<T>, MessageEditData> embed, Function<ListPageBag<T>, MessageEditData> empty) -
pages
int pages()The amount of pages.- Returns:
- Page count
-
isEmpty
-
current
int current()Get the current index of the page. The index is zero based- Returns:
- the current page index. Zero based
-
current
void current(int page) Set the current index of the page. The index is zero based- Parameters:
page- the current page index. Zero based
-
scrollNext
void scrollNext()Goes to the next page index -
hasNext
boolean hasNext()Checks if there is a next page- Returns:
- true when there is a next page
-
scrollPrevious
void scrollPrevious()Goes to the previous page index -
hasPrevious
boolean hasPrevious()Checks if there is a previous page- Returns:
- true when there is a previous page
-
buttons
Get additional buttons which should be added to the page- Returns:
- list fo buttons
-
buildPage
-
buildEmptyPage
Build an embed for an empty page when the bag is empty- Returns:
- A message embed.
- Throws:
EmptyPageBagException- when not overridden.
-
canInteract
Defines if a user can interact with this page or not.- Parameters:
user- user to check- Returns:
- true if the user can interact
-