Package com.couchbase.client.java.view
Class DefaultViewResult
java.lang.Object
com.couchbase.client.java.view.DefaultViewResult
- All Implemented Interfaces:
ViewResult,Iterable<ViewRow>
public class DefaultViewResult extends Object implements ViewResult
-
Constructor Summary
Constructors Constructor Description DefaultViewResult(CouchbaseEnvironment env, Bucket bucket, rx.Observable<AsyncViewRow> rows, int totalRows, boolean success, rx.Observable<JsonObject> error, JsonObject debug) -
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>iterator()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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultViewResult
public DefaultViewResult(CouchbaseEnvironment env, Bucket bucket, rx.Observable<AsyncViewRow> rows, int totalRows, boolean success, rx.Observable<JsonObject> error, JsonObject debug)
-
-
Method Details
-
allRows
Description copied from interface:ViewResultCollects all rows received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Specified by:
allRowsin interfaceViewResult- Returns:
- a (potentially empty)
Listcontaining view rows.
-
allRows
Description copied from interface:ViewResultCollects all rows received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Specified by:
allRowsin interfaceViewResult- Returns:
- a (potentially empty)
Listcontaining view rows.
-
rows
Description copied from interface:ViewResultEmits oneViewRowfor each row received from the view with the default view timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Specified by:
rowsin interfaceViewResult- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
rows
Description copied from interface:ViewResultEmits oneViewRowfor each row received from the view with a custom timeout. This method throws: -TimeoutExceptionwrapped in aRuntimeException: If the timeout is exceeded.- Specified by:
rowsin interfaceViewResult- Parameters:
timeout- the custom timeout.timeUnit- the time unit for the custom timeout.- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
iterator
-
totalRows
public int totalRows()Description copied from interface:ViewResultThe total number of rows.- Specified by:
totalRowsin interfaceViewResult- Returns:
- number of rows.
-
success
public boolean success()Description copied from interface:ViewResultIf the query was successful.- Specified by:
successin interfaceViewResult- Returns:
- true if it was, false otherwise.
-
error
Description copied from interface:ViewResultIf it was not successful, an error is contained here.- Specified by:
errorin interfaceViewResult- Returns:
- the potential error.
-
error
Description copied from interface:ViewResultIf it was not successful, an error is contained here.- Specified by:
errorin interfaceViewResult- Returns:
- the potential error.
-
debug
Description copied from interface:ViewResultIf debug was enabled on the query, it is contained here.- Specified by:
debugin interfaceViewResult- Returns:
- the debug info.
-