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.JsonObjectgeometry()The geometry of the row, if emitted.Stringid()The id of the document, if not reduced.JsonArraykey()The key of the row.StringtoString()Objectvalue()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:AsyncSpatialViewRowThe id of the document, if not reduced.- Specified by:
idin interfaceAsyncSpatialViewRow- Returns:
- the id of the document.
-
key
public JsonArray key()
Description copied from interface:AsyncSpatialViewRowThe key of the row.- Specified by:
keyin interfaceAsyncSpatialViewRow- Returns:
- the key.
-
value
public Object value()
Description copied from interface:AsyncSpatialViewRowThe value of the row. The object can be any valid JSON object, includingJsonArrayorJsonObject.- Specified by:
valuein interfaceAsyncSpatialViewRow- Returns:
- the value if set.
-
geometry
public JsonObject geometry()
Description copied from interface:AsyncSpatialViewRowThe geometry of the row, if emitted. Note that the geometry is only set if GeoJSON is emitted by the spatial view.- Specified by:
geometryin interfaceAsyncSpatialViewRow- Returns:
- the GeoJSON geometry if set.
-
document
public rx.Observable<JsonDocument> document()
Description copied from interface:AsyncSpatialViewRowLoad the underlying document. TheObservablecan 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:
documentin interfaceAsyncSpatialViewRow- Returns:
- a
Observablecontaining the document once loaded.
-
document
public <D extends Document<?>> rx.Observable<D> document(Class<D> target)
Description copied from interface:AsyncSpatialViewRowLoad the underlying document. TheObservablecan 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:
documentin interfaceAsyncSpatialViewRow- Parameters:
target- the target class to decode into.- Returns:
- a
Observablecontaining the document once loaded.
-
-