Package com.helixframework.db.pagination
Class CursorPagedResult<T>
java.lang.Object
com.helixframework.db.pagination.CursorPagedResult<T>
- Type Parameters:
T- type of result
- All Implemented Interfaces:
Iterable<T>
Cursor paginated results collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <T> CursorPagedResult<T>Creates a newCursorPagedResultobject with the given cursor and results.Retrieves the cursor value.Retrieves the list of results.inthashCode()iterator()voidSets the cursor value.voidsetResults(List<T> results) Sets the list of results.longsize()Retrieves the size of the results list.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CursorPagedResult
public CursorPagedResult()
-
-
Method Details
-
from
Creates a newCursorPagedResultobject with the given cursor and results.- Type Parameters:
T- The type of the elements in the results list.- Parameters:
cursor- The cursor to set in the CursorPagedResult object.results- The list of results to set in the CursorPagedResult object.- Returns:
- The newly created CursorPagedResult object
-
size
public long size()Retrieves the size of the results list.- Returns:
- The size of the results list. If the results list is null, returns 0
-
getCursor
Retrieves the cursor value.- Returns:
- page cursor
-
setCursor
Sets the cursor value.- Parameters:
cursor- page cursor
-
getResults
Retrieves the list of results.- Returns:
- The list of results. If the results list is null, returns an empty list
-
setResults
Sets the list of results.- Parameters:
results- The list of results to set
-
iterator
-
equals
-
hashCode
public int hashCode()
-