java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.pagination.source.PageResult<T>

public final class PageResult<T> extends Object
Immutable outcome of one page load: the page's items plus the total number of elements in the backing store, which drives getTotalPages() and navigation clamping.
  • Method Details

    • of

      public static <T> PageResult<T> of(List<T> items, int totalElements)
      Creates a page result.
      Type Parameters:
      T - the element type
      Parameters:
      items - the page's items; copied defensively, must contain at most the requested page size (oversized results are truncated with a warning)
      totalElements - the total number of elements in the backing store
      Returns:
      the immutable result
      Throws:
      NullPointerException - if items is null
      IllegalArgumentException - if totalElements is negative