Class ScrollPositionCursorStrategy
java.lang.Object
org.springframework.graphql.data.query.ScrollPositionCursorStrategy
- All Implemented Interfaces:
CursorStrategy<org.springframework.data.domain.ScrollPosition>
public final class ScrollPositionCursorStrategy
extends Object
implements CursorStrategy<org.springframework.data.domain.ScrollPosition>
Strategy to convert a
ScrollPosition to and from a String cursor.- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev, Oliver Drotbohm
-
Constructor Summary
ConstructorsConstructorDescriptionShortcut constructor that usesJsonKeysetCursorStrategy.ScrollPositionCursorStrategy(CursorStrategy<Map<String, Object>> keysetCursorStrategy) Constructor with a given strategy to convert akeysetto and from a cursor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.ScrollPositionfromCursor(String cursor) Parse the given String cursor into a position Object.booleanWhether the strategy supports the given type of position Object.toCursor(org.springframework.data.domain.ScrollPosition position) Format the given position Object as a String cursor.
-
Constructor Details
-
ScrollPositionCursorStrategy
public ScrollPositionCursorStrategy()Shortcut constructor that usesJsonKeysetCursorStrategy. -
ScrollPositionCursorStrategy
Constructor with a given strategy to convert akeysetto and from a cursor.
-
-
Method Details
-
supports
Description copied from interface:CursorStrategyWhether the strategy supports the given type of position Object.- Specified by:
supportsin interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>
-
toCursor
Description copied from interface:CursorStrategyFormat the given position Object as a String cursor.- Specified by:
toCursorin interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>- Parameters:
position- the position to serialize- Returns:
- the created String cursor
-
fromCursor
Description copied from interface:CursorStrategyParse the given String cursor into a position Object.- Specified by:
fromCursorin interfaceCursorStrategy<org.springframework.data.domain.ScrollPosition>- Parameters:
cursor- the cursor to parse- Returns:
- the position Object
-