Class PageRequestWithOffset

java.lang.Object
org.springframework.data.domain.AbstractPageRequest
org.springframework.data.domain.PageRequest
ru.sergkorot.dynamic.model.paging.PageRequestWithOffset
All Implemented Interfaces:
Serializable, org.springframework.data.domain.Pageable

public class PageRequestWithOffset extends org.springframework.data.domain.PageRequest
Author:
Sergey Korotaev Implementing PageRequest with offset and without using page
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    PageRequestWithOffset(int offset, int size, org.springframework.data.domain.Sort sort)
    Base Constructor for building PageRequest with offset and without using page
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    of(int offset, int limit, org.springframework.data.domain.Sort sort)
    Static method for building PageRequest extension
    of(Integer offset, Integer limit, List<org.springframework.data.domain.Sort.Order> sortOrders)
    Static method for building PageRequest extension

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

    equals, first, getSort, hashCode, next, of, of, ofSize, previous, toString, withPage, withSort, withSort

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

    getPageNumber, getPageSize, hasPrevious, previousOrFirst

    Methods inherited from class java.lang.Object

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

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

    getSortOr, isPaged, isUnpaged, toOptional, toScrollPosition
  • Constructor Details

    • PageRequestWithOffset

      public PageRequestWithOffset(int offset, int size, org.springframework.data.domain.Sort sort)
      Base Constructor for building PageRequest with offset and without using page
      Parameters:
      offset - - Shift relative to the beginning of the list
      size - - Number of list items to return
      sort - - settings for sort
  • Method Details

    • of

      public static PageRequestWithOffset of(Integer offset, Integer limit, List<org.springframework.data.domain.Sort.Order> sortOrders)
      Static method for building PageRequest extension
      Parameters:
      offset - - Shift relative to the beginning of the list
      limit - - Number of list items to return
      sortOrders - - list with settings for sort
      Returns:
      - PageRequestWithOffset
    • of

      public static PageRequestWithOffset of(int offset, int limit, @NonNull org.springframework.data.domain.Sort sort)
      Static method for building PageRequest extension
      Parameters:
      offset - - Shift relative to the beginning of the list
      limit - - Number of list items to return
      sort - - settings for sort
      Returns:
      - PageRequestWithOffset
    • getOffset

      public long getOffset()
      Specified by:
      getOffset in interface org.springframework.data.domain.Pageable
      Overrides:
      getOffset in class org.springframework.data.domain.AbstractPageRequest