Package cn.dinodev.spring.data.domain
Class LimitOffsetPageable
java.lang.Object
cn.dinodev.spring.data.domain.LimitOffsetPageable
- All Implemented Interfaces:
Serializable,org.springframework.data.domain.Pageable
public class LimitOffsetPageable
extends Object
implements org.springframework.data.domain.Pageable, Serializable
- Author:
- Cody Lu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLimitOffsetPageable(long offset, int limit) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequestLimitOffsetPageable(long offset, int limit, org.springframework.data.domain.Sort sort) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequestLimitOffsetPageable(long offset, int limit, org.springframework.data.domain.Sort.Direction direction, String... properties) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequest -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Pageablefirst()longintintorg.springframework.data.domain.SortgetSort()booleanorg.springframework.data.domain.Pageablenext()previous()返回上一页的分页对象org.springframework.data.domain.Pageableorg.springframework.data.domain.PageablewithPage(int pageNumber) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.domain.Pageable
getSortOr, isPaged, isUnpaged, toLimit, toOptional, toScrollPosition
-
Constructor Details
-
LimitOffsetPageable
public LimitOffsetPageable(long offset, int limit, org.springframework.data.domain.Sort sort) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequest- Parameters:
offset- zero-based offset.limit- the size of the elements to be returned.sort- can be null.
-
LimitOffsetPageable
public LimitOffsetPageable(long offset, int limit, org.springframework.data.domain.Sort.Direction direction, String... properties) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequest- Parameters:
offset- zero-based offset.limit- the size of the elements to be returned.direction- the direction of theSortto be specified, can be null.properties- the properties to sort by, must not be null or empty.
-
LimitOffsetPageable
public LimitOffsetPageable(long offset, int limit) Creates a newwith sort parameters applied.invalid reference
OffsetBasedPageRequest- Parameters:
offset- zero-based offset.limit- the size of the elements to be returned.
-
-
Method Details
-
getPageNumber
public int getPageNumber()- Specified by:
getPageNumberin interfaceorg.springframework.data.domain.Pageable
-
getPageSize
public int getPageSize()- Specified by:
getPageSizein interfaceorg.springframework.data.domain.Pageable
-
getOffset
public long getOffset()- Specified by:
getOffsetin interfaceorg.springframework.data.domain.Pageable
-
getSort
@NonNull public org.springframework.data.domain.Sort getSort()- Specified by:
getSortin interfaceorg.springframework.data.domain.Pageable
-
next
@NonNull public org.springframework.data.domain.Pageable next()- Specified by:
nextin interfaceorg.springframework.data.domain.Pageable
-
previous
返回上一页的分页对象- Returns:
- 如果有上一页则返回上一页的分页对象,否则返回当前分页对象
-
previousOrFirst
@NonNull public org.springframework.data.domain.Pageable previousOrFirst()- Specified by:
previousOrFirstin interfaceorg.springframework.data.domain.Pageable
-
first
@NonNull public org.springframework.data.domain.Pageable first()- Specified by:
firstin interfaceorg.springframework.data.domain.Pageable
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceorg.springframework.data.domain.Pageable
-
withPage
@NonNull public org.springframework.data.domain.Pageable withPage(int pageNumber) - Specified by:
withPagein interfaceorg.springframework.data.domain.Pageable
-