Package com.couchbase.client.java.view
Class DefaultSpatialViewResult
java.lang.Object
com.couchbase.client.java.view.DefaultSpatialViewResult
- All Implemented Interfaces:
SpatialViewResult
,Iterable<SpatialViewRow>
public class DefaultSpatialViewResult extends Object implements SpatialViewResult
Default implementation of the
SpatialViewResult
.- Since:
- 2.1.0
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Constructor Description DefaultSpatialViewResult(CouchbaseEnvironment env, Bucket bucket, rx.Observable<AsyncSpatialViewRow> rows, boolean success, rx.Observable<JsonObject> error, JsonObject debug)
-
Method Summary
Modifier and Type Method Description List<SpatialViewRow>
allRows()
Collects all rows received from the view with the default view timeout.List<SpatialViewRow>
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<SpatialViewRow>
iterator()
Iterator<SpatialViewRow>
rows()
Emits oneViewRow
for each row received from the view with the default view timeout.Iterator<SpatialViewRow>
rows(long timeout, TimeUnit timeUnit)
Emits oneViewRow
for each row received from the view with a custom timeout.boolean
success()
If the query was successful.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultSpatialViewResult
public DefaultSpatialViewResult(CouchbaseEnvironment env, Bucket bucket, rx.Observable<AsyncSpatialViewRow> rows, boolean success, rx.Observable<JsonObject> error, JsonObject debug)
-
-
Method Details
-
allRows
Description copied from interface:SpatialViewResult
Collects all rows received from the view with the default view timeout. This method throws: -TimeoutException
wrapped in aRuntimeException
: If the timeout is exceeded.- Specified by:
allRows
in interfaceSpatialViewResult
- Returns:
- a (potentially empty)
List
containing view rows.
-
allRows
Description copied from interface:SpatialViewResult
Collects all rows received from the view with the default view timeout. This method throws: -TimeoutException
wrapped in aRuntimeException
: If the timeout is exceeded.- Specified by:
allRows
in interfaceSpatialViewResult
- Returns:
- a (potentially empty)
List
containing view rows.
-
rows
Description copied from interface:SpatialViewResult
Emits oneViewRow
for each row received from the view with the default view timeout. This method throws: -TimeoutException
wrapped in aRuntimeException
: If the timeout is exceeded.- Specified by:
rows
in interfaceSpatialViewResult
- Returns:
- a (potentially empty)
Iterator
containing view rows.
-
rows
Description copied from interface:SpatialViewResult
Emits oneViewRow
for each row received from the view with a custom timeout. This method throws: -TimeoutException
wrapped in aRuntimeException
: If the timeout is exceeded.- Specified by:
rows
in interfaceSpatialViewResult
- Parameters:
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.- Returns:
- a (potentially empty)
Iterator
containing view rows.
-
success
public boolean success()Description copied from interface:SpatialViewResult
If the query was successful.- Specified by:
success
in interfaceSpatialViewResult
- Returns:
- true if it was, false otherwise.
-
error
Description copied from interface:SpatialViewResult
If it was not successful, an error is contained here.- Specified by:
error
in interfaceSpatialViewResult
- Returns:
- the potential error.
-
error
Description copied from interface:SpatialViewResult
If it was not successful, an error is contained here.- Specified by:
error
in interfaceSpatialViewResult
- Returns:
- the potential error.
-
debug
Description copied from interface:SpatialViewResult
If debug was enabled on the query, it is contained here.- Specified by:
debug
in interfaceSpatialViewResult
- Returns:
- the debug info.
-
iterator
- Specified by:
iterator
in interfaceIterable<SpatialViewRow>
-