public class DefaultViewResult extends Object implements ViewResult
Constructor and Description |
---|
DefaultViewResult(CouchbaseEnvironment env,
Bucket bucket,
rx.Observable<AsyncViewRow> rows,
int totalRows,
boolean success,
rx.Observable<JsonObject> error,
JsonObject debug) |
Modifier and Type | Method and 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.
|
JsonObject |
debug()
If debug was enabled on the query, it is contained here.
|
JsonObject |
error()
If it was not successful, an error is contained here.
|
JsonObject |
error(long timeout,
TimeUnit timeUnit)
If it was not successful, an error is contained here.
|
Iterator<ViewRow> |
iterator() |
Iterator<ViewRow> |
rows()
Emits one
ViewRow for each row received from the view with the default view timeout. |
Iterator<ViewRow> |
rows(long timeout,
TimeUnit timeUnit)
Emits one
ViewRow for each row received from the view with a custom timeout. |
boolean |
success()
If the query was successful.
|
int |
totalRows()
The total number of rows.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DefaultViewResult(CouchbaseEnvironment env, Bucket bucket, rx.Observable<AsyncViewRow> rows, int totalRows, boolean success, rx.Observable<JsonObject> error, JsonObject debug)
public List<ViewRow> allRows()
ViewResult
TimeoutException
wrapped in a RuntimeException
: If the timeout is exceeded.allRows
in interface ViewResult
List
containing view rows.public List<ViewRow> allRows(long timeout, TimeUnit timeUnit)
ViewResult
TimeoutException
wrapped in a RuntimeException
: If the timeout is exceeded.allRows
in interface ViewResult
List
containing view rows.public Iterator<ViewRow> rows()
ViewResult
ViewRow
for each row received from the view with the default view timeout.
This method throws:
- TimeoutException
wrapped in a RuntimeException
: If the timeout is exceeded.rows
in interface ViewResult
Iterator
containing view rows.public Iterator<ViewRow> rows(long timeout, TimeUnit timeUnit)
ViewResult
ViewRow
for each row received from the view with a custom timeout.
This method throws:
- TimeoutException
wrapped in a RuntimeException
: If the timeout is exceeded.rows
in interface ViewResult
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.Iterator
containing view rows.public int totalRows()
ViewResult
totalRows
in interface ViewResult
public boolean success()
ViewResult
success
in interface ViewResult
public JsonObject error()
ViewResult
error
in interface ViewResult
public JsonObject error(long timeout, TimeUnit timeUnit)
ViewResult
error
in interface ViewResult
public JsonObject debug()
ViewResult
debug
in interface ViewResult
Copyright © 2015 Couchbase, Inc.