Class Page<T>
java.lang.Object
org.apache.juneau.commons.beanquery.Page<T>
- Type Parameters:
T- The row type.
One page of query results, plus the optional counts selected by the session's
CountPolicy.
total(): rows that pass the guards (before the search).matched(): rows that pass the guards and the search.
Under CountPolicy.NONE neither count is present. Under CountPolicy.MATCHED only
matched() is. Under CountPolicy.BOTH both are. Counts are opt-in and independent of each
other: a caller that did not ask for a count gets an empty OptionalLong back rather than an exception, so
"was a count computed" and "read the count" are the same call.
Example:
Page<Person>
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()matched()The number of rows that survive the search, before any page limit.static <T> Page<T>Creates a page without counts.static <T> Page<T>Creates a page with both counts.static <T> Page<T>Creates a page with only the matched count.rows()Returns the rows of this page.toString()total()The number of rows in scope before the query's search (after any server-only guard).
-
Method Details
-
of
Creates a page without counts.- Type Parameters:
T- The row type.- Parameters:
rows- The rows. Must not benull or containnull .- Returns:
- A new page.
-
of
Creates a page with both counts.- Type Parameters:
T- The row type.- Parameters:
rows- The rows. Must not benull or containnull .total- The number of rows that pass the guards.matched- The number of rows that pass the guards and the search.- Returns:
- A new page.
-
ofMatched
Creates a page with only the matched count.- Type Parameters:
T- The row type.- Parameters:
rows- The rows. Must not benull or containnull .matched- The number of rows that pass the guards and the search.- Returns:
- A new page.
-
rows
Returns the rows of this page.- Returns:
- An unmodifiable list (never
null ).
-
total
The number of rows in scope before the query's search (after any server-only guard).- Returns:
- The total row count, or empty if it was not requested.
-
matched
The number of rows that survive the search, before any page limit.- Returns:
- The matched row count, or empty if it was not requested.
-
equals
-
hashCode
-
toString
-