Class PagedSelectResults<T>

java.lang.Object
org.springframework.data.gemfire.repository.query.AbstractSelectResults<T>
org.springframework.data.gemfire.repository.query.PagedSelectResults<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, org.apache.geode.cache.query.SelectResults<T>

public class PagedSelectResults<T> extends AbstractSelectResults<T>
An Apache Geode SelectResults implementation with support for Paging.
Since:
2.4.0
See Also:
  • Field Details

  • Constructor Details

    • PagedSelectResults

      public PagedSelectResults(@NonNull org.apache.geode.cache.query.SelectResults<T> selectResults, @NonNull org.springframework.data.domain.Pageable pageable)
      Constructs a new instance of PagedSelectResults initialized with the given, required SelectResults and Pageable object encapsulating the details of the requested page.
      Parameters:
      selectResults - SelectResults to wrap; must not be null.
      pageable - Pageable object encapsulating the details of the requested page; must not be null.
      Throws:
      IllegalArgumentException - if the SelectResults or the Pageable object is null.
      See Also:
      • SelectResults
      • Pageable
  • Method Details

    • getPageRequest

      @NonNull protected org.springframework.data.domain.Pageable getPageRequest()
      Returns the Pageable object encapsulating the details of the requested page.
      Returns:
      the Pageable object encapsulating the details of the requested page.
      See Also:
      • Pageable
    • asSet

      public Set<T> asSet()
      Specified by:
      asSet in interface org.apache.geode.cache.query.SelectResults<T>
      Overrides:
      asSet in class AbstractSelectResults<T>
    • asList

      public List<T> asList()
      Specified by:
      asList in interface org.apache.geode.cache.query.SelectResults<T>
      Overrides:
      asList in class AbstractSelectResults<T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Overrides:
      iterator in class AbstractSelectResults<T>
    • size

      public int size()
      Specified by:
      size in interface Collection<T>
      Overrides:
      size in class AbstractSelectResults<T>
    • with

      public PagedSelectResults<T> with(@NonNull org.springframework.data.domain.Pageable pageRequest)
      Builder method used to allow a new page request in order to get a different page of results from the underlying SelectResults.
      Parameters:
      pageRequest - Pageable object encapsulating the details of the requested page; must not be null.
      Returns:
      this PagedSelectResults.
      Throws:
      IllegalArgumentException - if Pageable is null.
      See Also:
      • Pageable