Package org.springframework.data.domain
Class OffsetScrollPosition
java.lang.Object
org.springframework.data.domain.OffsetScrollPosition
- All Implemented Interfaces:
ScrollPosition
A
ScrollPosition
based on the offsets within query results.- Since:
- 3.1
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
int
hashCode()
static OffsetScrollPosition
initial()
Creates a new initialOffsetScrollPosition
to start scrolling using offset/limit.boolean
Returns whether the current scroll position is the initial one.static OffsetScrollPosition
of
(long offset) Creates a newOffsetScrollPosition
from anoffset
.static IntFunction<OffsetScrollPosition>
positionFunction
(long startOffset) Returns theposition function
to calculate.toString()
-
Method Details
-
initial
Creates a new initialOffsetScrollPosition
to start scrolling using offset/limit.- Returns:
- a new initial
OffsetScrollPosition
to start scrolling using offset/limit.
-
of
Creates a newOffsetScrollPosition
from anoffset
.- Parameters:
offset
-- Returns:
- a new
OffsetScrollPosition
with the givenoffset
.
-
positionFunction
Returns theposition function
to calculate.- Parameters:
startOffset
- the start offset to be used. Must not be negative.- Returns:
- the offset-based position function.
-
isInitial
public boolean isInitial()Description copied from interface:ScrollPosition
Returns whether the current scroll position is the initial one.- Specified by:
isInitial
in interfaceScrollPosition
- Returns:
-
getOffset
public long getOffset()- Returns:
- the offset.
-
equals
-
hashCode
public int hashCode() -
toString
-