Package com.helixframework.db.pagination
Class OffsetPagedResult<T>
java.lang.Object
com.helixframework.db.pagination.OffsetPagedResult<T>
- Type Parameters:
T- type of result
- All Implemented Interfaces:
Iterable<T>
Offset paginated results collection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <T> OffsetPagedResult<T>Creates anOffsetPagedResultobject with the given limit, offset, and results.longgetLimit()Returns the limit value.longReturns the offset value.Returns the list of results.inthashCode()iterator()voidsetLimit(long limit) Sets the limit value.voidsetOffset(long offset) Sets the offset value.voidsetResults(List<T> results) Sets the list of results.longsize()Returns the size of the list of results.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
-
OffsetPagedResult
public OffsetPagedResult()
-
-
Method Details
-
from
Creates anOffsetPagedResultobject with the given limit, offset, and results.- Type Parameters:
T- the type of the result- Parameters:
limit- the maximum number of results in each pageoffset- the starting index of the resultsresults- the list of results- Returns:
- the OffsetPagedResult object
-
size
public long size()Returns the size of the list of results.- Returns:
- the size of the list of results, or 0 if the list is empty or null
-
getLimit
public long getLimit()Returns the limit value.- Returns:
- pagination limit
-
setLimit
public void setLimit(long limit) Sets the limit value.- Parameters:
limit- the maximum number of results in each page
-
getOffset
public long getOffset()Returns the offset value.- Returns:
- the starting index of the results
-
setOffset
public void setOffset(long offset) Sets the offset value.- Parameters:
offset- the starting index of the results
-
getResults
Returns the list of results.- Returns:
- the list of results
-
setResults
Sets the list of results.- Parameters:
results- the list of results to be set
-
iterator
-
equals
-
hashCode
public int hashCode()
-