Class PagedLiveData<T>

Type Parameters:
T - the generic type
All Implemented Interfaces:
PagedResult, PageNavigator, PageRequest

public abstract class PagedLiveData<T> extends KriptonXLiveData<T> implements PagedResult
The paged version of KriptonLiveData.
Author:
Francesco Benincasa (info@abubusoft.com)
  • Constructor Details

  • Method Details

    • createPageRequestBuilder

      public PagedLiveData<T>.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:
    • getExecutor

      public PageRequestExecutor<T> getExecutor()
    • 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
    • nextPage

      public void nextPage()
      Description copied from interface: PageNavigator
      Navigates to next page.
      Specified by:
      nextPage 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
    • previousPage

      public void previousPage()
      Description copied from interface: PageNavigator
      Navigates to previous page.
      Specified by:
      previousPage in interface PageNavigator
    • firstPage

      public void firstPage()
      Description copied from interface: PageNavigator
      Navigate to the first page.
      Specified by:
      firstPage 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:
    • setPageSize

      public void setPageSize(int pageSize)
      Description copied from interface: PageNavigator
      Set page size
      Specified by:
      setPageSize in interface PageNavigator
    • 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
    • lastPage

      public void lastPage()
      Description copied from interface: PageNavigator
      Navigate to last page
      Specified by:
      lastPage in interface PageNavigator
    • 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
    • isLast

      public boolean isLast()
      Specified by:
      isLast in interface PagedResult
    • isFirst

      public boolean isFirst()
      Specified by:
      isFirst in interface PagedResult
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface PagedResult
    • hasPrevious

      public boolean hasPrevious()
      Specified by:
      hasPrevious in interface PagedResult