public class PageQuery extends Object implements Serializable
org.springframework.data.domain.Page is powerful, but with heavy deps. - page, 1-based, not less than 1. - size, 1-based, not less than 1. - sort empty means null, `,` delimited, eg. 'key1,-key2' means `key1 asc, key2 desc`.
| Modifier and Type | Field and Description |
|---|---|
protected int |
page |
protected int |
size |
protected String |
sort |
| Constructor and Description |
|---|
PageQuery() |
PageQuery(int page,
int size) |
PageQuery(int page,
int size,
String sort) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getPage()
The current page number, 1-based, not less than 1.
|
int |
getSize()
The size of each page, 1-based, not less than 1.
|
@NotNull String |
getSort()
Fixed-format sorting clause.
|
int |
hashCode() |
PageQuery |
setPage(int page) |
PageQuery |
setSize(int size) |
PageQuery |
setSort(String sort) |
int |
toOffset()
Get the data offset of the current page, 0-based.
|
String |
toString() |
protected int page
protected int size
protected String sort
public PageQuery()
public PageQuery(int page,
int size)
public PageQuery(int page,
int size,
String sort)
public int getPage()
@Contract(value="_->this") public PageQuery setPage(int page)
public int getSize()
@Contract(value="_->this") public PageQuery setSize(int size)
@NotNull public @NotNull String getSort()
PageUtil.sort(String)public int toOffset()
Copyright © 2024. All rights reserved.