Class Pagination
java.lang.Object
com.eqixiac.equinix.core.http.response.Pagination
Pagination metadata returned by Equinix API list operations.
Contains offset-based pagination information including the current offset, page size (limit), total result count, and links to previous/next pages. Provides convenience methods for computing page numbers and detecting first/last pages.
- Author:
- ianjones
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the zero-based page number computed from the current offset and limit.intReturns the page size (number of results per page), which equals the limit, or0when the limit is absent.booleanReturnstrueif the current page is the first page of results.booleanReturnstrueif the current page is the last page of results.
-
Constructor Details
-
Pagination
public Pagination()
-
-
Method Details
-
getPageNumber
public int getPageNumber()Returns the zero-based page number computed from the current offset and limit. Returns0when offset/limit are absent (some endpoints omit pagination metadata, e.g. on empty results) so the value is never an unboxing NPE or a divide-by-zero.- Returns:
- the current page number (0-indexed)
-
getPageSize
public int getPageSize()Returns the page size (number of results per page), which equals the limit, or0when the limit is absent.- Returns:
- the number of results per page
-
isFirstPage
public boolean isFirstPage()Returnstrueif the current page is the first page of results.- Returns:
trueif this is page 0
-
isLastPage
public boolean isLastPage()Returnstrueif the current page is the last page of results. When the total or limit is absent (some endpoints omittotalon empty results), the current page is treated as the last so paging terminates gracefully rather than NPE-ing or looping.- Returns:
trueif there are no more pages after this one
-