Package io.inversion
Class Results<M extends java.util.Map<java.lang.String,?>>
- java.lang.Object
-
- io.inversion.Results<M>
-
- All Implemented Interfaces:
java.lang.Iterable<M>
public final class Results<M extends java.util.Map<java.lang.String,?>> extends java.lang.Object implements java.lang.Iterable<M>Results are returned by a Db and transformed by Actions into Response content.Dbs are not responsible for mapping from column names to json names so a Results rows and terms will use column names until they are potentially transformed by an Action.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdebugQueryprotected intfoundRowsThe total number of rows (if known) in the Db that match the query, not the number of rows returned in this Results.static java.lang.StringLAST_QUERYprotected java.util.List<io.inversion.rql.Term>nextThe RQL terms that will get the next page of results the DB things there are more results.protected Queryquerythe query that produced these results.protected java.util.List<M>rowsThe data the query produced.protected java.lang.StringtestQuery
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFoundRows()java.util.List<io.inversion.rql.Term>getNext()QuerygetQuery()MgetRow(int index)java.util.List<M>getRows()java.lang.StringgetTestQuery()java.util.Iterator<M>iterator()ResultssetRow(int index, M row)intsize()ResultswithFoundRows(int foundRows)ResultswithNext(io.inversion.rql.Term next)ResultswithNext(java.util.List<io.inversion.rql.Term> next)ResultswithQuery(Query query)ResultswithRow(M row)ResultswithRows(java.util.List rows)ResultswithTestQuery(java.lang.String testQuery)
-
-
-
Field Detail
-
LAST_QUERY
public static java.lang.String LAST_QUERY
-
next
protected final java.util.List<io.inversion.rql.Term> next
The RQL terms that will get the next page of results the DB things there are more results.Dbs are not responsible for mapping from column names to json names so these terms will have column names when initially returned from the Db.
Actions should map the keys to the corresponding json name property names before returning to the caller.
-
query
protected Query query
the query that produced these results.
-
rows
protected java.util.List<M extends java.util.Map<java.lang.String,?>> rows
The data the query produced.Dbs are not responsible for mapping from column names to json names so these maps will have column names keys when initially returned from the Db.
Actions should map them to the corresponding json property names before returning to the caller.
-
foundRows
protected int foundRows
The total number of rows (if known) in the Db that match the query, not the number of rows returned in this Results.For paginated listings, foundRows generally be greater than rows.size()
-
debugQuery
protected java.lang.String debugQuery
-
testQuery
protected java.lang.String testQuery
-
-
Method Detail
-
getQuery
public Query getQuery()
-
iterator
public java.util.Iterator<M> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<M extends java.util.Map<java.lang.String,?>>
-
size
public int size()
-
getRow
public M getRow(int index)
-
getRows
public java.util.List<M> getRows()
-
withRows
public Results withRows(java.util.List rows)
-
getNext
public java.util.List<io.inversion.rql.Term> getNext()
-
withNext
public Results withNext(io.inversion.rql.Term next)
-
withNext
public Results withNext(java.util.List<io.inversion.rql.Term> next)
-
getFoundRows
public int getFoundRows()
-
withFoundRows
public Results withFoundRows(int foundRows)
-
getTestQuery
public java.lang.String getTestQuery()
-
withTestQuery
public Results withTestQuery(java.lang.String testQuery)
-
-