Package alpine.persistence
Class PaginatedResult
java.lang.Object
alpine.persistence.PaginatedResult
- All Implemented Interfaces:
Serializable
PaginatedResult is a container class that provides a complete (or partial)
Collection (List/Set) of results along with the total number of results
for the query.
- Since:
- 1.0.0
- Author:
- Steve Springett
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> List<T>Retrieves a List of objects from the result.Retrieves a Collection of objects from the result.<T> Set<T>Retrieves a Set of objects from the result.longgetTotal()Retrieves the total number of results.Fluent.objects(Collection<?> collection) Fluent.voidsetObjects(Object object) Specifies a Collection of objects from the result.voidsetObjects(Collection<?> collection) Specifies a Collection of objects from the result.voidsetTotal(long total) Specifies the total number of results.total(long total) Fluent.
-
Constructor Details
-
PaginatedResult
public PaginatedResult()
-
-
Method Details
-
getTotal
public long getTotal()Retrieves the total number of results.- Returns:
- the total number of results
- Since:
- 1.0.0
-
setTotal
public void setTotal(long total) Specifies the total number of results.- Parameters:
total- the total number of results- Since:
- 1.0.0
-
total
Fluent. Specifies the total number of results.- Parameters:
total- the total number of results- Returns:
- the current PaginatedResult instance
- Since:
- 1.0.0
-
getObjects
Retrieves a Collection of objects from the result.- Returns:
- a Collection of objects from the result.
- Since:
- 1.0.0
-
getList
Retrieves a List of objects from the result.- Type Parameters:
T- the type defined in the List- Parameters:
clazz- the type defined in the List- Returns:
- a Collection of objects from the result.
- Since:
- 1.0.0
-
getSet
Retrieves a Set of objects from the result.- Type Parameters:
T- the type defined in the Set- Parameters:
clazz- the type defined in the Set- Returns:
- a Collection of objects from the result.
- Since:
- 1.0.0
-
setObjects
Specifies a Collection of objects from the result.- Parameters:
collection- a Collection of objects from the result.- Since:
- 1.0.0
-
objects
Fluent. Specifies a Collection of objects from the result.- Parameters:
collection- a Collection of objects from the result.- Returns:
- the current PaginatedResult instance
- Since:
- 1.0.0
-
setObjects
Specifies a Collection of objects from the result.- Parameters:
object- a Collection of objects from the result.- Since:
- 1.0.0
-
objects
Fluent. Specifies a Collection of objects from the result.- Parameters:
object- a Collection of objects from the result.- Returns:
- the current PaginatedResult instance
- Since:
- 1.0.0
-