Package com.couchbase.client.java.view
Class DefaultAsyncSpatialViewRow
- java.lang.Object
-
- com.couchbase.client.java.view.DefaultAsyncSpatialViewRow
-
- All Implemented Interfaces:
AsyncSpatialViewRow
public class DefaultAsyncSpatialViewRow extends Object implements AsyncSpatialViewRow
Default implementation of aAsyncSpatialViewRow
.- Since:
- 2.1.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultAsyncSpatialViewRow(AsyncBucket bucket, String id, JsonArray key, Object value, JsonObject geometry, Document<?> document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description rx.Observable<JsonDocument>
document()
Load the underlying document.<D extends Document<?>>
rx.Observable<D>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.
-
-
-
Constructor Detail
-
DefaultAsyncSpatialViewRow
public DefaultAsyncSpatialViewRow(AsyncBucket bucket, String id, JsonArray key, Object value, JsonObject geometry, Document<?> document)
-
-
Method Detail
-
id
public String id()
Description copied from interface:AsyncSpatialViewRow
The id of the document, if not reduced.- Specified by:
id
in interfaceAsyncSpatialViewRow
- Returns:
- the id of the document.
-
key
public JsonArray key()
Description copied from interface:AsyncSpatialViewRow
The key of the row.- Specified by:
key
in interfaceAsyncSpatialViewRow
- Returns:
- the key.
-
value
public Object value()
Description copied from interface:AsyncSpatialViewRow
The value of the row. The object can be any valid JSON object, includingJsonArray
orJsonObject
.- Specified by:
value
in interfaceAsyncSpatialViewRow
- Returns:
- the value if set.
-
geometry
public JsonObject geometry()
Description copied from interface:AsyncSpatialViewRow
The geometry of the row, if emitted. Note that the geometry is only set if GeoJSON is emitted by the spatial view.- Specified by:
geometry
in interfaceAsyncSpatialViewRow
- Returns:
- the GeoJSON geometry if set.
-
document
public rx.Observable<JsonDocument> document()
Description copied from interface:AsyncSpatialViewRow
Load the underlying document. TheObservable
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.- Specified by:
document
in interfaceAsyncSpatialViewRow
- Returns:
- a
Observable
containing the document once loaded.
-
document
public <D extends Document<?>> rx.Observable<D> document(Class<D> target)
Description copied from interface:AsyncSpatialViewRow
Load the underlying document. TheObservable
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.- Specified by:
document
in interfaceAsyncSpatialViewRow
- Parameters:
target
- the target class to decode into.- Returns:
- a
Observable
containing the document once loaded.
-
-