Package alpine.persistence
Class Pagination
java.lang.Object
alpine.persistence.Pagination
Defines pagination used during a request.
- Since:
- 1.0.0
- Author:
- Steve Springett
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPagination(Pagination.Strategy strategy, int o1, int o2) Creates a new Pagination object with the specified offset and limit, or page number and size.Pagination(Pagination.Strategy strategy, String o1, String o2) Creates a new Pagination object with the specified offset and limit, or page number and size. -
Method Summary
Modifier and TypeMethodDescriptionintgetLimit()Returns the limit.intReturns the offset.Returns the pagination strategy used.booleanReturns if pagination is being used for this request.
-
Constructor Details
-
Pagination
Creates a new Pagination object with the specified offset and limit, or page number and size. If any parameters are null, a value of 0 will be used.- Parameters:
strategy- the pagination strategy to useo1- the offset or page number to useo2- the number of results to limit a result-set to (aka, the size of the page)
-
Pagination
Creates a new Pagination object with the specified offset and limit, or page number and size. If any parameters are null, a value of 0 will be used.- Parameters:
strategy- the pagination strategy to useo1- the offset or page number to useo2- the number of results to limit a result-set to (aka, the size of the page)
-
-
Method Details
-
getStrategy
Returns the pagination strategy used.- Returns:
- the pagination strategy
-
getOffset
public int getOffset()Returns the offset.- Returns:
- the offset
-
getLimit
public int getLimit()Returns the limit.- Returns:
- the limit
-
isPaginated
public boolean isPaginated()Returns if pagination is being used for this request. A page number and page size greater than 0 will return true. If either of those are 0, method will return false.- Returns:
- if paginiation is used for this request
-