Class Pagination

java.lang.Object
com.eqixiac.equinix.core.http.response.Pagination

public class Pagination extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the zero-based page number computed from the current offset and limit.
    int
    Returns the page size (number of results per page), which equals the limit, or 0 when the limit is absent.
    boolean
    Returns true if the current page is the first page of results.
    boolean
    Returns true if the current page is the last page of results.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pagination

      public Pagination()
  • Method Details

    • getPageNumber

      public int getPageNumber()
      Returns the zero-based page number computed from the current offset and limit. Returns 0 when 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, or 0 when the limit is absent.
      Returns:
      the number of results per page
    • isFirstPage

      public boolean isFirstPage()
      Returns true if the current page is the first page of results.
      Returns:
      true if this is page 0
    • isLastPage

      public boolean isLastPage()
      Returns true if the current page is the last page of results. When the total or limit is absent (some endpoints omit total on empty results), the current page is treated as the last so paging terminates gracefully rather than NPE-ing or looping.
      Returns:
      true if there are no more pages after this one