public class DefaultAsyncSpatialViewRow extends Object implements AsyncSpatialViewRow
Default implementation of a AsyncSpatialViewRow
.
Constructor and Description |
---|
DefaultAsyncSpatialViewRow(AsyncBucket bucket,
String id,
JsonArray key,
Object value,
JsonObject geometry,
Document<?> document) |
Modifier and Type | Method and Description |
---|---|
Observable<JsonDocument> |
document()
Load the underlying document.
|
<D extends Document<?>> |
document(Class<D> target)
Load the underlying document.
|
JsonObject |
geometry()
The geometry of the row, if emitted.
|
String |
id()
The id of the document, if not reduced.
|
JsonArray |
key()
The key of the row.
|
String |
toString() |
Object |
value()
The value of the row.
|
public DefaultAsyncSpatialViewRow(AsyncBucket bucket, String id, JsonArray key, Object value, JsonObject geometry, Document<?> document)
public String id()
AsyncSpatialViewRow
The id of the document, if not reduced.
id
in interface AsyncSpatialViewRow
public JsonArray key()
AsyncSpatialViewRow
The key of the row.
key
in interface AsyncSpatialViewRow
public Object value()
AsyncSpatialViewRow
The value of the row.
The object can be any valid JSON object, including JsonArray
or JsonObject
.
value
in interface AsyncSpatialViewRow
public JsonObject geometry()
AsyncSpatialViewRow
The geometry of the row, if emitted.
Note that the geometry is only set if GeoJSON is emitted by the spatial view.
geometry
in interface AsyncSpatialViewRow
public Observable<JsonDocument> document()
AsyncSpatialViewRow
Load the underlying document.
The Observable
can error under the following conditions:
BackpressureException
: If the incoming request rate is too high to be processed.IllegalStateException
: If the view is reduced and the ID is null.TranscodingException
: If the response document could not be decoded.document
in interface AsyncSpatialViewRow
Observable
containing the document once loaded.public <D extends Document<?>> Observable<D> document(Class<D> target)
AsyncSpatialViewRow
Load the underlying document.
The Observable
can error under the following conditions:
BackpressureException
: If the incoming request rate is too high to be processed.IllegalStateException
: If the view is reduced and the ID is null.TranscodingException
: If the response document could not be decoded.document
in interface AsyncSpatialViewRow
target
- the target class to decode into.Observable
containing the document once loaded.Copyright © 2014 Couchbase, Inc.