Class PageImpl<Entity>

    • Constructor Detail

      • PageImpl

        public PageImpl​(List<Entity> content,
                        int pageNumber,
                        int itemsNumber,
                        int totalPages,
                        long totalItems,
                        boolean hasNext)
        Constructor of PageImpl.
        Parameters:
        content - the content of this page, must not be null.
        pageNumber - the number of the current page
        itemsNumber - the number of elements on the page
        totalPages - the number of total pages
        totalItems - the total amount of elements
        hasNext - is there a next page exists
    • Method Detail

      • createInstance

        public static <E> PageImpl<E> createInstance​(List<E> content,
                                                     String pageNumber,
                                                     String itemsNumber,
                                                     String totalPages,
                                                     String totalItems,
                                                     String hasNext)
        Safe create instance of Page.
        Type Parameters:
        E - type of page entity
        Parameters:
        content - the content of this page, must not be null.
        pageNumber - the number of the current page
        itemsNumber - the number of elements on the page
        totalPages - the number of total pages
        totalItems - the total amount of elements
        hasNext - is there a next page exists
      • getPageNumber

        public int getPageNumber()
        Description copied from interface: Page
        Returns the number of the current page. Is always non-negative.
        Specified by:
        getPageNumber in interface Page<Entity>
        Returns:
        the number of the current page.
      • getItemsNumber

        public int getItemsNumber()
        Description copied from interface: Page
        Returns the number of elements on the page.
        Specified by:
        getItemsNumber in interface Page<Entity>
        Returns:
        the number of elements on the page.
      • getTotalPages

        public int getTotalPages()
        Description copied from interface: Page
        Returns the number of total pages.
        Specified by:
        getTotalPages in interface Page<Entity>
        Returns:
        the number of total pages
      • getTotalItems

        public long getTotalItems()
        Description copied from interface: Page
        Returns the total amount of elements.
        Specified by:
        getTotalItems in interface Page<Entity>
        Returns:
        the total amount of elements
      • hasNext

        public boolean hasNext()
        Description copied from interface: Page
        Returns if there is a next page exists.
        Specified by:
        hasNext in interface Page<Entity>
        Returns:
        true if there is a next page exists, otherwise false.
      • getContent

        public List<Entity> getContent()
        Description copied from interface: Page
        Return container content.
        Specified by:
        getContent in interface Page<Entity>
        Returns:
        container content
      • hasContent

        public boolean hasContent()
        Description copied from interface: Page
        Returns if there is a content exists.
        Specified by:
        hasContent in interface Page<Entity>
        Returns:
        true if there is a content exists, otherwise false