Class EncodingCursorStrategy<T>
java.lang.Object
org.springframework.graphql.data.pagination.EncodingCursorStrategy<T>
- Type Parameters:
T- the type of position
- All Implemented Interfaces:
CursorStrategy<T>
Decorator for a
CursorStrategy that applies a CursorEncoder
to the cursor String to make it opaque for external use.
To create an instance, use
CursorStrategy.withEncoder(CursorStrategy, CursorEncoder).
- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionfromCursor(String cursor) Parse the given String cursor into a position Object.Return the decoratedCursorStrategy.Return the configuredCursorEncoder.booleanWhether the strategy supports the given type of position Object.Format the given position Object as a String cursor.
-
Method Details
-
getDelegate
Return the decoratedCursorStrategy. -
getEncoder
Return the configuredCursorEncoder. -
supports
Description copied from interface:CursorStrategyWhether the strategy supports the given type of position Object.- Specified by:
supportsin interfaceCursorStrategy<T>- 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<T>- 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<T>- Parameters:
cursor- the cursor to parse- Returns:
- the position Object
-