Class PaginationUtil


  • public class PaginationUtil
    extends Object
    Author:
    Yohann Chastagnier
    • Method Detail

      • formatFromFirstIndexOfItem

        public static String formatFromFirstIndexOfItem​(int nbItemsPerPage,
                                                        int totalNumberOfItems,
                                                        int firstItemIndexOfCurrentPage)
        Centralizes the formatting of a pagniation context label.
        Parameters:
        nbItemsPerPage - the number of items displayed in a page.
        totalNumberOfItems - the total number of items that can be displayed.
        firstItemIndexOfCurrentPage - the index in the list of items of the first item to display in the current page.
        Returns:
        the counter as string.
      • formatFromFirstIndexOfItem

        public static String formatFromFirstIndexOfItem​(PaginationPage paginationPage,
                                                        int totalNumberOfItems)
        Centralizes the formatting of a pagniation context label.
        Parameters:
        paginationPage - the pagination page.
        totalNumberOfItems - the total number of items that can be displayed. in the current page.
        Returns:
        the counter as string.