Class PagedLiveData<T>

    • Method Detail

      • createPageRequestBuilder

        public PagedLiveData.PageRequestBuilder createPageRequestBuilder()
        Allows to create a builder for a page request. This builder is usefully when you need to modify different parameter of page request and you want to make only a page request.
        Returns:
      • getPageNumber

        public int getPageNumber()
        Description copied from interface: PageRequest
        Current page
        Specified by:
        getPageNumber in interface PageRequest
        Returns:
        Current page
      • getPageSize

        public int getPageSize()
        Description copied from interface: PageRequest
        Page size used to navigate
        Specified by:
        getPageSize in interface PageRequest
        Returns:
        Page size used to navigate
      • setPage

        public void setPage​(int page)
        Description copied from interface: PageNavigator
        Navigates to the page. This method is an alternative to offset.
        Specified by:
        setPage in interface PageNavigator
      • setOffset

        public void setOffset​(int offset)
        Description copied from interface: PageNavigator
        Navigates to the offset. This method is an alternative to page.
        Specified by:
        setOffset in interface PageNavigator
      • getOffset

        public int getOffset()
        Description copied from interface: PageRequest
        Set the current offset from start of dataset.
        Specified by:
        getOffset in interface PageRequest
        Returns:
      • getTotalElements

        public int getTotalElements()
        Description copied from interface: PagedResult
        Returns the total amount of elements.
        Specified by:
        getTotalElements in interface PagedResult
        Returns:
        the total amount of elements
      • getTotalPages

        public int getTotalPages()
        Description copied from interface: PagedResult
        Returns the number of total pages.
        Specified by:
        getTotalPages in interface PagedResult
        Returns:
        the number of total pages