Package graphql.annotations.connection
Class NaivePaginatedData<T>
- java.lang.Object
-
- graphql.annotations.connection.AbstractPaginatedData<T>
-
- graphql.annotations.connection.NaivePaginatedData<T>
-
- All Implemented Interfaces:
PaginatedData<T>,java.lang.Iterable<T>
public class NaivePaginatedData<T> extends AbstractPaginatedData<T>
-
-
Constructor Summary
Constructors Constructor Description NaivePaginatedData(boolean hasPreviousPage, boolean hasNextPage, java.lang.Iterable<T> data)NaivePaginatedData(boolean hasPreviousPage, boolean hasNextPage, java.lang.Iterable<T> data, java.lang.String prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCursor(T entity)creates the cursor by offset (i.e first entity has cursor 0, the second has 1 and so on) NOTE: to make it consistent, please make the data ordered-
Methods inherited from class graphql.annotations.connection.AbstractPaginatedData
hasNextPage, hasPreviousPage, iterator
-
-
-
-
Method Detail
-
getCursor
public java.lang.String getCursor(T entity)
creates the cursor by offset (i.e first entity has cursor 0, the second has 1 and so on) NOTE: to make it consistent, please make the data ordered- Parameters:
entity- the entity- Returns:
- the cursor of the entity (i.e the offset)
-
-