Class Pageables


  • public abstract class Pageables
    extends Object
    Author:
    Kohsuke Kawaguchi
    • Method Detail

      • empty

        public static <T> Pageable<T> empty()
        Returns an empty Pageable
        Type Parameters:
        T - type of Pageable item
        Returns:
        empty pageable collection
      • slice

        public static <T> Iterator<T> slice​(Iterator<T> base,
                                            int start,
                                            int limit)
        Poorman's Pageable implementation that does skipping by simply fast-forwarding Iterator
        Type Parameters:
        T - type of Pageable item
        Parameters:
        base - base collection
        start - starting index requested from collection
        limit - max number of item requested in the page
        Returns:
        iterator with starting index==start and size < limit
      • wrap

        public static <T> Pageable<T> wrap​(Iterable<T> base)
        Wraps Iterable into a Pageable
        Parameters:
        base - collection to be wrapped in to Pageable
        Returns:
        Pageable collection