- Type Parameters:
R- the type of the results.
- All Superinterfaces:
Iterable<R>
A slice of query results: the shape a
Page, a Window and a plain slice share.
A slice holds its content in the order it was read and says whether rows existed after and before it at query
time. It iterates over its content, so a loop reads for (user : slice). A page adds a total count and
navigates by page number, a window navigates by keyset, and the plain slice that slice(pageable) returns
is a page without the count query, navigated through its Pageable.
- Since:
- 1.10
-
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the results in this slice, in the order they were read.booleanhasNext()Returnstrueif rows existed after this slice at query time.booleanReturnstrueif rows existed before this slice at query time.default booleanisEmpty()Returnstrueif this slice holds no results.iterator()static <R> Slice<R> Creates a plain slice with the given content and flags.default intsize()Returns the number of results in this slice.stream()Returns the results as a stream.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
content
Returns the results in this slice, in the order they were read.- Returns:
- the content; never contains
nullelements.
-
hasNext
boolean hasNext()Returnstrueif rows existed after this slice at query time.- Returns:
trueif a next slice exists.
-
hasPrevious
boolean hasPrevious()Returnstrueif rows existed before this slice at query time.- Returns:
trueif a previous slice exists.
-
size
default int size()Returns the number of results in this slice.- Returns:
- the number of results.
-
isEmpty
default boolean isEmpty()Returnstrueif this slice holds no results.- Returns:
trueif the slice is empty.
-
iterator
-
stream
Returns the results as a stream.- Returns:
- a stream over the content.
-
of
Creates a plain slice with the given content and flags.- Type Parameters:
R- the type of the results.- Parameters:
content- the results.hasNext-trueif rows existed after the slice.hasPrevious-trueif rows existed before the slice.- Returns:
- the slice.
- Since:
- 1.14
-