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.
 
 An initial OffsetScrollPosition does not point to a specific element and is different to a position
 {ScrollPosition.offset(long).
- Since:
- 3.1
- Author:
- Mark Paluch, Oliver Drotbohm, Christoph Strobl, Yanming Zhou
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.data.domain.ScrollPositionScrollPosition.Direction
- 
Method SummaryModifier and TypeMethodDescriptionadvanceBy(long delta) Returns a newOffsetScrollPositionthat has been advanced by the given value.booleanlongThe zero or positive offset.inthashCode()booleanReturns whether the current scroll position is the initial one.Returns theposition functionstarting after the currentoffset.static IntFunction<OffsetScrollPosition>positionFunction(long startOffset) Returns aposition functionstarting atstartOffset.toString()
- 
Method Details- 
positionFunctionReturns aposition functionstarting atstartOffset.- Parameters:
- startOffset- the start offset to be used. Must not be negative.
- Returns:
- the offset-based position function.
 
- 
positionFunctionReturns theposition functionstarting after the currentoffset.- Returns:
- the offset-based position function.
- Since:
- 3.3
 
- 
getOffsetpublic long getOffset()The zero or positive offset.An initialposition does not define an offset and will raise an error.- Returns:
- the offset.
- Throws:
- IllegalStateException- if- isInitial().
 
- 
advanceByReturns a newOffsetScrollPositionthat has been advanced by the given value. Negative deltas will be constrained so that the new offset is at least zero.- Parameters:
- delta- the value to advance the current offset by.
- Returns:
- will never be null.
 
- 
isInitialpublic boolean isInitial()Description copied from interface:ScrollPositionReturns whether the current scroll position is the initial one.- Specified by:
- isInitialin interface- ScrollPosition
- Returns:
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-