Class CursorPagedResult<T>

java.lang.Object
com.helixframework.db.pagination.CursorPagedResult<T>
Type Parameters:
T - type of result
All Implemented Interfaces:
Iterable<T>

public class CursorPagedResult<T> extends Object implements Iterable<T>
Cursor paginated results collection.
  • Constructor Details

    • CursorPagedResult

      public CursorPagedResult()
  • Method Details

    • from

      public static <T> CursorPagedResult<T> from(String cursor, List<T> results)
      Creates a new CursorPagedResult object with the given cursor and results.
      Type Parameters:
      T - The type of the elements in the results list.
      Parameters:
      cursor - The cursor to set in the CursorPagedResult object.
      results - The list of results to set in the CursorPagedResult object.
      Returns:
      The newly created CursorPagedResult object
    • size

      public long size()
      Retrieves the size of the results list.
      Returns:
      The size of the results list. If the results list is null, returns 0
    • getCursor

      public String getCursor()
      Retrieves the cursor value.
      Returns:
      page cursor
    • setCursor

      public void setCursor(String cursor)
      Sets the cursor value.
      Parameters:
      cursor - page cursor
    • getResults

      public List<T> getResults()
      Retrieves the list of results.
      Returns:
      The list of results. If the results list is null, returns an empty list
    • setResults

      public void setResults(List<T> results)
      Sets the list of results.
      Parameters:
      results - The list of results to set
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object