Package st.orm

Interface Slice<R>

Type Parameters:
R - the result type of the slice content.
All Known Implementing Classes:
Page, Window

public interface Slice<R>
Represents a slice of query results — a chunk of data with informational navigation flags.

A Slice is the common base for both Window (cursor-based scrolling) and Page (offset-based pagination). It provides access to the result content and flags indicating whether adjacent results exist, without prescribing a specific navigation mechanism.

Since:
1.11
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the list of results in this slice.
    boolean
    Returns true if more results exist beyond this slice in the forward direction.
    boolean
    Returns true if results exist before this slice.
  • Method Details

    • content

      @Nonnull List<R> content()
      Returns the list of results in this slice. The list is immutable and never contains null elements.
      Returns:
      the results.
    • hasNext

      boolean hasNext()
      Returns true if more results exist beyond this slice in the forward direction.
      Returns:
      whether more results exist.
    • hasPrevious

      boolean hasPrevious()
      Returns true if results exist before this slice.
      Returns:
      whether previous results exist.