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 TypeMethodDescriptionbooleanlonginthashCode()static OffsetScrollPositioninitial()Creates a new initialOffsetScrollPositionto start scrolling using offset/limit.booleanReturns whether the current scroll position is the initial one.static OffsetScrollPositionof(long offset) Creates a newOffsetScrollPositionfrom anoffset.static IntFunction<OffsetScrollPosition>positionFunction(long startOffset) Returns theposition functionto calculate.toString()
-
Method Details
-
initial
Creates a new initialOffsetScrollPositionto start scrolling using offset/limit.- Returns:
- a new initial
OffsetScrollPositionto start scrolling using offset/limit.
-
of
Creates a newOffsetScrollPositionfrom anoffset.- Parameters:
offset-- Returns:
- a new
OffsetScrollPositionwith the givenoffset.
-
positionFunction
Returns theposition functionto 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:ScrollPositionReturns whether the current scroll position is the initial one.- Specified by:
isInitialin interfaceScrollPosition- Returns:
-
getOffset
public long getOffset()- Returns:
- the offset.
-
equals
-
hashCode
public int hashCode() -
toString
-