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 Details

    • ScrollPositionCursorStrategy

      public ScrollPositionCursorStrategy()
      Shortcut constructor that uses JsonKeysetCursorStrategy.
    • ScrollPositionCursorStrategy

      public ScrollPositionCursorStrategy(CursorStrategy<Map<String,Object>> keysetCursorStrategy)
      Constructor with a given strategy to convert a keyset to and from a cursor.
  • Method Details

    • supports

      public boolean supports(Class<?> targetType)
      Description copied from interface: CursorStrategy
      Whether the strategy supports the given type of position Object.
      Specified by:
      supports in interface CursorStrategy<org.springframework.data.domain.ScrollPosition>
    • toCursor

      public String toCursor(org.springframework.data.domain.ScrollPosition position)
      Description copied from interface: CursorStrategy
      Format the given position Object as a String cursor.
      Specified by:
      toCursor in interface CursorStrategy<org.springframework.data.domain.ScrollPosition>
      Parameters:
      position - the position to serialize
      Returns:
      the created String cursor
    • fromCursor

      public org.springframework.data.domain.ScrollPosition fromCursor(String cursor)
      Description copied from interface: CursorStrategy
      Parse the given String cursor into a position Object.
      Specified by:
      fromCursor in interface CursorStrategy<org.springframework.data.domain.ScrollPosition>
      Parameters:
      cursor - the cursor to parse
      Returns:
      the position Object