Class QueryResults<T>

java.lang.Object
com.querydsl.core.QueryResults<T>
Type Parameters:
T - type of result elements
All Implemented Interfaces:
Serializable

public final class QueryResults<T> extends Object implements Serializable
QueryResults bundles data for paged query results
Author:
tiwe
See Also:
  • Constructor Details

    • QueryResults

      public QueryResults(List<T> results, @Nullable @Nullable Long limit, @Nullable @Nullable Long offset, long total)
      Create a new QueryResults instance
      Parameters:
      results - paged results
      limit - used limit
      offset - used offset
      total - total result rows count
    • QueryResults

      public QueryResults(List<T> results, QueryModifiers mod, long total)
      Create a new QueryResults instance
      Parameters:
      results - paged results
      mod - limit and offset
      total - total result rows count
  • Method Details

    • emptyResults

      public static <T> QueryResults<T> emptyResults()
    • getResults

      public List<T> getResults()
      Get the results in List form An empty list is returned for no results.
      Returns:
      results
    • getTotal

      public long getTotal()
      Get the total number of results
      Returns:
      total rows
    • isEmpty

      public boolean isEmpty()
      Return whether there are results in the current query window
      Returns:
      true, if no results where found
    • getLimit

      public long getLimit()
      Get the limit value used for the query
      Returns:
      applied limit
    • getOffset

      public long getOffset()
      Get the offset value used for the query
      Returns:
      applied offset