Class JsonKeysetCursorStrategy
java.lang.Object
org.springframework.graphql.data.query.JsonKeysetCursorStrategy
- All Implemented Interfaces:
CursorStrategy<Map<String,Object>>
public final class JsonKeysetCursorStrategy
extends Object
implements CursorStrategy<Map<String,Object>>
Strategy to convert a
keyset to and
from a JSON String for use with ScrollPositionCursorStrategy.- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionShortcut constructor that usesServerCodecConfigurer.JsonKeysetCursorStrategy(CodecConfigurer codecConfigurer) Constructor with aCodecConfigurerin which to find the JSON encoder and decoder to use. -
Method Summary
Modifier and TypeMethodDescriptionfromCursor(String cursor) Parse the given String cursor into a position Object.booleanWhether the strategy supports the given type of position Object.Format the given position Object as a String cursor.
-
Constructor Details
-
JsonKeysetCursorStrategy
public JsonKeysetCursorStrategy()Shortcut constructor that usesServerCodecConfigurer. -
JsonKeysetCursorStrategy
Constructor with aCodecConfigurerin which to find the JSON encoder and decoder to use.- Parameters:
codecConfigurer- the codec configurer to be checked for JSON codec
-
-
Method Details
-
supports
Description copied from interface:CursorStrategyWhether the strategy supports the given type of position Object.- Specified by:
supportsin interfaceCursorStrategy<Map<String,Object>> - Parameters:
targetType- the type of position to be checked
-
toCursor
Description copied from interface:CursorStrategyFormat the given position Object as a String cursor.- Specified by:
toCursorin interfaceCursorStrategy<Map<String,Object>> - Parameters:
keys- 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<Map<String,Object>> - Parameters:
cursor- the cursor to parse- Returns:
- the position Object
-