Interface IPageBag

All Known Implementing Classes:
ListPageBag, PageBag, PrivateListPageBag, PrivatePageBag

public interface IPageBag
  • Method Details

    • standard

      static IPageBag standard(int pages, Supplier<MessageEditData> embed)
    • standard

      static IPageBag standard(int pages, Function<IPageBag, MessageEditData> embed, Function<IPageBag, MessageEditData> empty)
    • list

      static <T> IPageBag list(List<T> pages, Function<ListPageBag<T>, MessageEditData> embed)
    • 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

      default boolean isEmpty()
      Checks if the page count is 0.
      Returns:
      true if pages() returns 0
    • 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

      default List<PageButton> buttons()
      Get additional buttons which should be added to the page
      Returns:
      list fo buttons
    • buildPage

      MessageEditData buildPage()
      Build the embed for the page.
      Returns:
      A message embed.
    • buildEmptyPage

      default MessageEditData buildEmptyPage()
      Build an embed for an empty page when the bag is empty
      Returns:
      A message embed.
      Throws:
      EmptyPageBagException - when not overridden.
    • canInteract

      default boolean canInteract(User user)
      Defines if a user can interact with this page or not.
      Parameters:
      user - user to check
      Returns:
      true if the user can interact