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.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<SpatialViewRow>iterator()Iterator<SpatialViewRow>rows()Emits oneViewRowfor each row received from the view with the default view timeout.Iterator<SpatialViewRow>rows(long timeout, TimeUnit timeUnit)Emits oneViewRowfor each row received from the view with a custom timeout.booleansuccess()If the query was successful.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
-
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:SpatialViewResultCollects 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 interfaceSpatialViewResult- Returns:
- a (potentially empty)
Listcontaining view rows.
-
allRows
Description copied from interface:SpatialViewResultCollects 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 interfaceSpatialViewResult- Returns:
- a (potentially empty)
Listcontaining view rows.
-
rows
Description copied from interface:SpatialViewResultEmits 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 interfaceSpatialViewResult- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
rows
Description copied from interface:SpatialViewResultEmits 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 interfaceSpatialViewResult- Parameters:
timeout- the custom timeout.timeUnit- the time unit for the custom timeout.- Returns:
- a (potentially empty)
Iteratorcontaining view rows.
-
success
public boolean success()Description copied from interface:SpatialViewResultIf the query was successful.- Specified by:
successin interfaceSpatialViewResult- Returns:
- true if it was, false otherwise.
-
error
Description copied from interface:SpatialViewResultIf it was not successful, an error is contained here.- Specified by:
errorin interfaceSpatialViewResult- Returns:
- the potential error.
-
error
Description copied from interface:SpatialViewResultIf it was not successful, an error is contained here.- Specified by:
errorin interfaceSpatialViewResult- Returns:
- the potential error.
-
debug
Description copied from interface:SpatialViewResultIf debug was enabled on the query, it is contained here.- Specified by:
debugin interfaceSpatialViewResult- Returns:
- the debug info.
-
iterator
- Specified by:
iteratorin interfaceIterable<SpatialViewRow>
-