Package com.couchbase.client.java.view
Interface ViewResult
- All Known Implementing Classes:
DefaultViewResult
@Committed @Public public interface ViewResult extends Iterable<ViewRow>
Represents the result from a
ViewQuery.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
Method Summary
Modifier and Type Method Description List<ViewRow>allRows()Collects all rows received from the view with the default view timeout.List<ViewRow>allRows(long timeout, TimeUnit timeUnit)Collects all rows received from the view with the default view timeout.JsonObjectdebug()If debug was enabled on the query, it is contained here.JsonObjecterror()If it was not successful, an error is contained here.JsonObjecterror(long timeout, TimeUnit timeUnit)If it was not successful, an error is contained here.Iterator<ViewRow>rows()Emits oneViewRowfor each row received from the view with the default view timeout.Iterator<ViewRow>rows(long timeout, TimeUnit timeUnit)Emits oneViewRowfor each row received from the view with a custom timeout.booleansuccess()If the query was successful.inttotalRows()The total number of rows.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
allRows
Collects all rows received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Returns:
- a (potentially empty)
Listcontaining view rows.
-
allRows
Collects all rows received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Returns:
- a (potentially empty)
Listcontaining view rows.
-
rows
Emits oneViewRowfor each row received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
rows
Emits oneViewRowfor each row received from the view with a custom timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Parameters:
timeout- the custom timeout.timeUnit- the time unit for the custom timeout.- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
totalRows
int totalRows()The total number of rows.- Returns:
- number of rows.
-
success
boolean success()If the query was successful.- Returns:
- true if it was, false otherwise.
-
error
JsonObject error()If it was not successful, an error is contained here.- Returns:
- the potential error.
-
error
If it was not successful, an error is contained here.- Returns:
- the potential error.
-
debug
JsonObject debug()If debug was enabled on the query, it is contained here.- Returns:
- the debug info.
-