java.lang.Object
org.miaixz.bus.pager.Serialize<T>
- Type Parameters:
T- the type of elements in the paginated data
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Paginating
Paging information class used to store the result set and total number of records for a paginated query. This class
supports serialization.
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetList()Retrieves the paginated result set.longgetTotal()Retrieves the total number of records.static <T> Serialize<T> Static factory method to create a Serialize object.voidSets the paginated result set.voidsetTotal(long total) Sets the total number of records.toString()Returns a string representation of the Serialize object.
-
Field Details
-
total
protected long totalThe total number of records. -
list
The paginated result set.
-
-
Constructor Details
-
Serialize
public Serialize()Default constructor for Serialize. -
Serialize
Constructs a Serialize object based on a given list of results. If the list is an instance ofPage, the total will be retrieved from it; otherwise, the total will be the size of the list.- Parameters:
list- the list of paginated results
-
-
Method Details
-
of
Static factory method to create a Serialize object.- Type Parameters:
T- the type of elements in the paginated data- Parameters:
list- the list of paginated results- Returns:
- a new Serialize object
-
getTotal
public long getTotal()Retrieves the total number of records.- Returns:
- the total number of records
-
setTotal
public void setTotal(long total) Sets the total number of records.- Parameters:
total- the total number of records to set
-
getList
Retrieves the paginated result set.- Returns:
- the list of paginated results
-
setList
Sets the paginated result set.- Parameters:
list- the list of paginated results to set
-
toString
Returns a string representation of the Serialize object.
-