Package graphql.annotations.connection
Interface PaginatedData<T>
-
- Type Parameters:
T- the data of which we paginated over
- All Superinterfaces:
java.lang.Iterable<T>
- All Known Implementing Classes:
AbstractPaginatedData,NaivePaginatedData
public interface PaginatedData<T> extends java.lang.Iterable<T>This class is the result of a connection. Every Graphql connection field must return this interfaceNOTE: this interface extends Iterable. The data is retrieved from the "iterator" function. Please implement the iterator with data structure that has order
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetCursor(T entity)get the encoded cursor of the entitybooleanhasNextPage()Whether or not this is the last pagebooleanhasPreviousPage()Whether or not this is the first page
-
-
-
Method Detail
-
hasNextPage
boolean hasNextPage()
Whether or not this is the last page- Returns:
- true if there is a next page, false otherwise
-
hasPreviousPage
boolean hasPreviousPage()
Whether or not this is the first page- Returns:
- true if there is a previous page, false otherwise
-
getCursor
java.lang.String getCursor(T entity)
get the encoded cursor of the entity- Parameters:
entity- the entity- Returns:
- String representation of the cursor of the entity
-
-