Class NaivePaginatedData<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.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • NaivePaginatedData

        public NaivePaginatedData​(boolean hasPreviousPage,
                                  boolean hasNextPage,
                                  java.lang.Iterable<T> data)
      • NaivePaginatedData

        public NaivePaginatedData​(boolean hasPreviousPage,
                                  boolean hasNextPage,
                                  java.lang.Iterable<T> data,
                                  java.lang.String prefix)
    • 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)