Package org.springframework.data.domain
Interface ScrollPosition
- All Known Implementing Classes:
KeysetScrollPosition
,OffsetScrollPosition
public interface ScrollPosition
Interface to specify a position within a total query result. Scroll positions are used to start scrolling from the
beginning of a query result or to resume scrolling from a given position within the query result.
- Since:
- 3.1
- Author:
- Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Keyset scrolling direction. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeysetScrollPosition
Creates a newScrollPosition
from a key set scrolling backward.static KeysetScrollPosition
Creates a newScrollPosition
from a key set scrolling forward.boolean
Returns whether the current scroll position is the initial one.static KeysetScrollPosition
keyset()
Creates a new initialScrollPosition
to start scrolling using keyset-queries.static KeysetScrollPosition
of
(Map<String, ?> keys, ScrollPosition.Direction direction) Creates a newScrollPosition
from a key set andScrollPosition.Direction
.static OffsetScrollPosition
offset()
Creates a new initialScrollPosition
to start scrolling using offset / limit.static OffsetScrollPosition
offset
(long offset) Creates a newScrollPosition
from anoffset
.
-
Method Details
-
isInitial
boolean isInitial()Returns whether the current scroll position is the initial one.- Returns:
-
keyset
Creates a new initialScrollPosition
to start scrolling using keyset-queries.- Returns:
- will never be null.
-
offset
Creates a new initialScrollPosition
to start scrolling using offset / limit.- Returns:
- will never be null.
-
offset
Creates a newScrollPosition
from anoffset
.- Parameters:
offset
-- Returns:
- a new
OffsetScrollPosition
with the givenoffset
.
-
forward
Creates a newScrollPosition
from a key set scrolling forward.- Parameters:
keys
- must not be null.- Returns:
- will never be null.
-
backward
Creates a newScrollPosition
from a key set scrolling backward.- Parameters:
keys
- must not be null.- Returns:
- will never be null.
-
of
Creates a newScrollPosition
from a key set andScrollPosition.Direction
.- Parameters:
keys
- must not be null.direction
- must not be null.- Returns:
- will never be null.
-