Class WindowConnectionAdapter

java.lang.Object
org.springframework.graphql.data.pagination.ConnectionAdapterSupport<org.springframework.data.domain.ScrollPosition>
org.springframework.graphql.data.query.WindowConnectionAdapter
All Implemented Interfaces:
ConnectionAdapter

public final class WindowConnectionAdapter extends ConnectionAdapterSupport<org.springframework.data.domain.ScrollPosition> implements ConnectionAdapter
Adapter for Window to Connection.
Since:
1.2.0
Author:
Rossen Stoyanchev
  • Constructor Details

    • WindowConnectionAdapter

      public WindowConnectionAdapter(CursorStrategy<org.springframework.data.domain.ScrollPosition> strategy)
  • Method Details

    • supports

      public boolean supports(Class<?> containerType)
      Description copied from interface: ConnectionAdapter
      Whether the adapter supports the given Object container type.
      Specified by:
      supports in interface ConnectionAdapter
      Parameters:
      containerType - the container type to check for support
    • getContent

      public <T> Collection<T> getContent(Object container)
      Description copied from interface: ConnectionAdapter
      Return the contained items as a List.
      Specified by:
      getContent in interface ConnectionAdapter
      Type Parameters:
      T - the type of objects in the collection
      Parameters:
      container - the container of elements
    • hasPrevious

      public boolean hasPrevious(Object container)
      Description copied from interface: ConnectionAdapter
      Whether there are more pages before this one.
      Specified by:
      hasPrevious in interface ConnectionAdapter
      Parameters:
      container - the container of elements
    • hasNext

      public boolean hasNext(Object container)
      Description copied from interface: ConnectionAdapter
      Whether there are more pages after this one.
      Specified by:
      hasNext in interface ConnectionAdapter
      Parameters:
      container - the container of elements
    • cursorAt

      public String cursorAt(Object container, int index)
      Description copied from interface: ConnectionAdapter
      Return a cursor for the item at the given index.
      Specified by:
      cursorAt in interface ConnectionAdapter
      Parameters:
      container - the container of elements
      index - the index of an element in the container