Class PagedInventoryImpl

    • Constructor Detail

      • PagedInventoryImpl

        public PagedInventoryImpl()
    • Method Detail

      • getPage

        @NotNull
        public @NotNull Optional<Page> getPage​(int page)
        Description copied from interface: PagedInventory
        Retrieves the page specified.
        Specified by:
        getPage in interface PagedInventory
        Parameters:
        page - the page you want to retrieve
        Returns:
        empty optional if page wasn't found, or else optional with value
      • getPage

        @NotNull
        public @NotNull Optional<Page> getPage​(@NotNull
                                               @NotNull UUID page)
        Description copied from interface: PagedInventory
        Retrieves the page by the specified page uuid
        Specified by:
        getPage in interface PagedInventory
        Parameters:
        page - page uuid
        Returns:
        empty optional if page wasn't found, or else optional with value
      • getPageNumber

        @NotNull
        public @NotNull OptionalInt getPageNumber​(@NotNull
                                                  @NotNull Page page)
        Description copied from interface: PagedInventory
        Retrieves the page number of the page specified.
        Specified by:
        getPageNumber in interface PagedInventory
        Parameters:
        page - the page object you want to get numbe
        Returns:
        number of the page if present
      • getPageNumber

        @NotNull
        public @NotNull OptionalInt getPageNumber​(@NotNull
                                                  @NotNull UUID page)
        Description copied from interface: PagedInventory
        Retrieves the page number of the page uuid specified
        Specified by:
        getPageNumber in interface PagedInventory
        Parameters:
        page - page uuid
        Returns:
        number of the page if present
      • setPage

        public void setPage​(int pageNum,
                            @NotNull
                            @NotNull Page page)
        Description copied from interface: PagedInventory
        Sets the specified Page number to the specified Page in this PagedInventory
        Specified by:
        setPage in interface PagedInventory
        Parameters:
        pageNum - the page number you want to override/set
        page - the page you want to set
      • setNavigationItem

        public void setNavigationItem​(int pos,
                                      @NotNull
                                      @NotNull NavigationItem item)
        Description copied from interface: PagedInventory
        Sets the specified NavigationItem on the specified Inventory position.
        Specified by:
        setNavigationItem in interface PagedInventory
        Parameters:
        pos - the inventory position you want the item on
        item - the navigation item you want to set
      • removeNavigationItem

        public void removeNavigationItem​(int pos)
        Description copied from interface: PagedInventory
        Removes the specified NavigationItem on that position.
        Specified by:
        removeNavigationItem in interface PagedInventory
        Parameters:
        pos - the position of the navigation item you want to remove
      • open

        public void open​(@NotNull
                         @NotNull org.bukkit.entity.Player viewer,
                         int page)
        Description copied from interface: PagedInventory
        Opens the specified page and adds the Player to the cache.
        Specified by:
        open in interface PagedInventory
        Parameters:
        viewer - viewer
        page - page
      • openPrevious

        public void openPrevious​(@NotNull
                                 @NotNull org.bukkit.entity.Player viewer)
        Description copied from interface: PagedInventory
        Opens the previous page of the page viewed by the player if present
        Specified by:
        openPrevious in interface PagedInventory
        Parameters:
        viewer - player viewer
      • openNext

        public void openNext​(@NotNull
                             @NotNull org.bukkit.entity.Player viewer)
        Description copied from interface: PagedInventory
        Opens the next page of the page viewed by the player if present
        Specified by:
        openNext in interface PagedInventory
        Parameters:
        viewer - player viewer
      • getPageViewed

        @NotNull
        public @NotNull Optional<Page> getPageViewed​(@NotNull
                                                     @NotNull org.bukkit.entity.Player viewer)
        Description copied from interface: PagedInventory
        Returns the page, currently viewed by the specified Player viewer
        Specified by:
        getPageViewed in interface PagedInventory
        Parameters:
        viewer - player viewer
        Returns:
        page viewed if present
      • getViewers

        @NotNull
        public @NotNull Map<UUID,​UUID> getViewers()
        Description copied from interface: PagedInventory
        Returns a immutable map of the known viewers and the viewed pages, key being a Player's UUID, and value being a Page's UUID
        Specified by:
        getViewers in interface PagedInventory
        Returns:
        viewers