Package alpine.resources
Class Pagination
- java.lang.Object
-
- alpine.resources.Pagination
-
public class Pagination extends Object
Defines pagination used during a request.- Since:
- 1.0.0
- Author:
- Steve Springett
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPagination.Strategy
-
Constructor Summary
Constructors Constructor Description Pagination(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLimit()Returns the limit.intgetOffset()Returns the offset.Pagination.StrategygetStrategy()Returns the pagination strategy used.booleanisPaginated()Returns if pagination is being used for this request.
-
-
-
Constructor Detail
-
Pagination
public Pagination(Pagination.Strategy strategy, int o1, int o2)
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
public Pagination(Pagination.Strategy strategy, String o1, String o2)
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 Detail
-
getStrategy
public Pagination.Strategy 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
-
-