Class Page<R>

java.lang.Object
com.datastax.astra.client.model.Page<R>
Type Parameters:
R - document type

public class Page<R> extends Object
Hold results for paging
Author:
Cedrick LUNVEN (@clunven)
  • Field Details

    • sortVector

      protected float[] sortVector
      Sort vector retrieved in the status.
  • Constructor Details

    • Page

      public Page(String pageState, List<R> results, float[] sortVector)
      Default constructor.
      Parameters:
      pageState - page state with the offset of the page
      results - List list of items for the page
      sortVector - float[] the sort vector if asked.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Express if results is empty.
      Returns:
      return value
    • findFirst

      public Optional<R> findFirst()
      Expected from a stream of result.
      Returns:
      first result if exist
    • one

      public R one()
      When the result is a singleton.
      Returns:
      result as a singleton
    • getPageState

      public Optional<String> getPageState()
      Getter accessor for attribute 'pageState'.
      Returns:
      current value of 'pageState'
    • getSortVector

      public Optional<float[]> getSortVector()
      If the sort Vector has been retrieved in the status, it will be available here.
      Returns:
      sort vector if available