类 PageResult<T>
java.lang.Object
com.infilake.openapi.bidding.model.base.PageResult<T>
- 类型参数:
T- The type of records in the page
Paginated response wrapper
Used for API endpoints that return paginated data:
{
"records": [...],
"total": 100,
"size": 10,
"current": 1
}
-
构造器概要
构造器构造器说明Default constructorPageResult(List<T> records, long total, int size, int current) Constructor with all fields -
方法概要
修饰符和类型方法说明intGet current page numberGet the list of recordsintgetSize()Get page sizelonggetTotal()Get total record countintGet total number of pagesbooleanhasNext()Check if there are more pagesbooleanCheck if there are previous pagesbooleanCheck if this is the first pagebooleanCheck if this is the last pagevoidsetCurrent(int current) Set current page numbervoidsetRecords(List<T> records) Set the list of recordsvoidsetSize(int size) Set page sizevoidsetTotal(long total) Set total record counttoString()
-
构造器详细资料
-
PageResult
public PageResult()Default constructor -
PageResult
Constructor with all fields- 参数:
records- List of recordstotal- Total record countsize- Page sizecurrent- Current page number
-
-
方法详细资料
-
isFirstPage
public boolean isFirstPage()Check if this is the first page- 返回:
- true if current page is 1
-
isLastPage
public boolean isLastPage()Check if this is the last page- 返回:
- true if this is the last page
-
getTotalPages
public int getTotalPages()Get total number of pages- 返回:
- Total pages
-
hasNext
public boolean hasNext()Check if there are more pages- 返回:
- true if there are more pages after current
-
hasPrevious
public boolean hasPrevious()Check if there are previous pages- 返回:
- true if there are pages before current
-
getRecords
Get the list of records- 返回:
- List of records
-
setRecords
Set the list of records- 参数:
records- List of records
-
getTotal
public long getTotal()Get total record count- 返回:
- Total records
-
setTotal
public void setTotal(long total) Set total record count- 参数:
total- Total records
-
getSize
public int getSize()Get page size- 返回:
- Page size
-
setSize
public void setSize(int size) Set page size- 参数:
size- Page size
-
getCurrent
public int getCurrent()Get current page number- 返回:
- Current page
-
setCurrent
public void setCurrent(int current) Set current page number- 参数:
current- Current page
-
toString
-