Class KeysetPageRequest

java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.domain.PageRequest
com.blazebit.persistence.spring.data.repository.KeysetPageRequest
All Implemented Interfaces:
KeysetPageable, Serializable, org.springframework.data.domain.Pageable

public class KeysetPageRequest extends org.springframework.data.domain.PageRequest implements KeysetPageable
Like PageRequest but with support for keyset pagination.
Since:
1.6.9
Author:
Christian Beikov, Eugen Mayer
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    KeysetPageRequest(int page, int pageSize, com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort)
    Construct a page request with an optional keyset page that may be used for keyset pagination.
    KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Pageable pageable)
    Construct a page request from a pageable with an optional keyset page that may be used for keyset pagination.
    KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort)
    Construct a page request representing the current page via a keyset page and a sort specification.
    KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort, int offset, int pageSize)
    Construct a page request with an optional keyset page that may be used for keyset pagination.
    KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort, int offset, int pageSize, boolean withCountQuery, boolean withExtractAllKeysets)
    Construct a page request with an optional keyset page that may be used for keyset pagination and flags to enable the count query and keyset extraction.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
     
    int
    Returns the offset as int.
    com.blazebit.persistence.KeysetPage
    Returns the keyset page information.
    int
     
    boolean
    Returns whether count query execution is enabled or not.
    boolean
    Returns whether extraction for all keysets is enabled or not.
     
     

    Methods inherited from class org.springframework.data.domain.PageRequest

    getSort, of, of, of, ofSize, previous, toString, withPage, withSort, withSort

    Methods inherited from class org.springframework.data.domain.AbstractPageRequest

    getOffset, getPageNumber, getPageSize, hasPrevious

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.data.domain.Pageable

    getOffset, getPageNumber, getPageSize, getSort, getSortOr, hasPrevious, isPaged, isUnpaged, toOptional, toScrollPosition, withPage
  • Constructor Details

    • KeysetPageRequest

      public KeysetPageRequest(int page, int pageSize, com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort)
      Construct a page request with an optional keyset page that may be used for keyset pagination.
      Parameters:
      page - The page number, 0-based
      pageSize - The number of elements per page
      keysetPage - The keyset page
      sort - The sort specification
    • KeysetPageRequest

      public KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Pageable pageable)
      Construct a page request from a pageable with an optional keyset page that may be used for keyset pagination.
      Parameters:
      keysetPage - The keyset page
      pageable - The pageable
    • KeysetPageRequest

      public KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort)
      Construct a page request representing the current page via a keyset page and a sort specification.
      Parameters:
      keysetPage - The keyset page
      sort - The sort specification
    • KeysetPageRequest

      public KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort, int offset, int pageSize)
      Construct a page request with an optional keyset page that may be used for keyset pagination.
      Parameters:
      keysetPage - The keyset page
      sort - The sort specification
      offset - The offset number, 0-based
      pageSize - The number of elements per page
      Since:
      1.3.0
    • KeysetPageRequest

      public KeysetPageRequest(com.blazebit.persistence.KeysetPage keysetPage, org.springframework.data.domain.Sort sort, int offset, int pageSize, boolean withCountQuery, boolean withExtractAllKeysets)
      Construct a page request with an optional keyset page that may be used for keyset pagination and flags to enable the count query and keyset extraction.
      Parameters:
      keysetPage - The keyset page
      sort - The sort specification
      offset - The offset number, 0-based
      pageSize - The number of elements per page
      withCountQuery - True to enable the count query
      withExtractAllKeysets - True to enable extraction of all keysets
      Since:
      1.4.0
  • Method Details

    • isWithCountQuery

      public boolean isWithCountQuery()
      Description copied from interface: KeysetPageable
      Returns whether count query execution is enabled or not.
      Specified by:
      isWithCountQuery in interface KeysetPageable
      Returns:
      true when enabled, false otherwise
    • isWithExtractAllKeysets

      public boolean isWithExtractAllKeysets()
      Description copied from interface: KeysetPageable
      Returns whether extraction for all keysets is enabled or not.
      Specified by:
      isWithExtractAllKeysets in interface KeysetPageable
      Returns:
      true when enabled, false otherwise
    • getIntOffset

      public int getIntOffset()
      Description copied from interface: KeysetPageable
      Returns the offset as int.
      Specified by:
      getIntOffset in interface KeysetPageable
      Returns:
      The offset as int
    • getKeysetPage

      public com.blazebit.persistence.KeysetPage getKeysetPage()
      Description copied from interface: KeysetPageable
      Returns the keyset page information.
      Specified by:
      getKeysetPage in interface KeysetPageable
      Returns:
      The keyset page
    • next

      public KeysetPageRequest next()
      Specified by:
      next in interface org.springframework.data.domain.Pageable
      Overrides:
      next in class org.springframework.data.domain.PageRequest
    • previousOrFirst

      public KeysetPageRequest previousOrFirst()
      Specified by:
      previousOrFirst in interface org.springframework.data.domain.Pageable
      Overrides:
      previousOrFirst in class org.springframework.data.domain.AbstractPageRequest
    • first

      public KeysetPageRequest first()
      Specified by:
      first in interface org.springframework.data.domain.Pageable
      Overrides:
      first in class org.springframework.data.domain.PageRequest
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.springframework.data.domain.PageRequest
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.springframework.data.domain.PageRequest