Interface PagedQuery

  • All Implemented Interfaces:

    
    public interface PagedQuery<R>
    
                        

    Used to build a Query that supports limit and offset.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface PagedQuery.ResultSet

      A result set containing the results of calling execute.

      Use this class to access the results of a query and to re-execute the query to retrieve following pages of results by using hasNext and next.

      Example usage:

      • Kotlin:
        
        val resultSet = query.execute()
        
        processResultsWithApplicationLogic(resultSet.results)
        
        while (resultSet.hasNext()) {
            val results = resultSet.next()
            processResultsWithApplicationLogic(results)
        }
        
      • Java:
        
        PagedQuery.ResultSet<Integer> resultSet = query.execute();
        
        processResultsWithApplicationLogic(resultSet.getResults());
        
        while (resultSet.hasNext()) {
            List<Integer> results = resultSet.next();
            processResultsWithApplicationLogic(results);
        }
        
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract PagedQuery<R> setLimit(int limit) Sets the maximum number of results to return.
      abstract PagedQuery<R> setOffset(int offset) Sets the index of the first result in the query to return.
      abstract PagedQuery.ResultSet<R> execute() Executes the PagedQuery.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • setLimit

        @NotNull() abstract PagedQuery<R> setLimit(int limit)

        Sets the maximum number of results to return.

        If no limit is set, all records will be returned.

        Parameters:
        limit - The maximum number of results to return.
      • setOffset

        @NotNull() abstract PagedQuery<R> setOffset(int offset)

        Sets the index of the first result in the query to return.

        A default of `0` will be used if it is not set.

        Parameters:
        offset - The index of the first result in the query to return.