Package com.couchbase.client.java.view
Class DefaultAsyncViewRow
- java.lang.Object
-
- com.couchbase.client.java.view.DefaultAsyncViewRow
-
- All Implemented Interfaces:
AsyncViewRow
public class DefaultAsyncViewRow extends Object implements AsyncViewRow
Default implementation of aAsyncViewRow.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description DefaultAsyncViewRow(AsyncBucket bucket, String id, Object key, Object value, Document<?> document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description rx.Observable<JsonDocument>document()Load the underlying document, if not reduced.<D extends Document<?>>
rx.Observable<D>document(Class<D> target)Load the underlying document, if not reduced.Stringid()The id of the document, if not reduced.Objectkey()The key of the row index.StringtoString()Objectvalue()The value of the row index.
-
-
-
Constructor Detail
-
DefaultAsyncViewRow
public DefaultAsyncViewRow(AsyncBucket bucket, String id, Object key, Object value, Document<?> document)
-
-
Method Detail
-
id
public String id()
Description copied from interface:AsyncViewRowThe id of the document, if not reduced.- Specified by:
idin interfaceAsyncViewRow- Returns:
- the id of the document.
-
key
public Object key()
Description copied from interface:AsyncViewRowThe key of the row index. The object can be any valid JSON object, includingJsonArrayorJsonObject.- Specified by:
keyin interfaceAsyncViewRow- Returns:
- the key.
-
value
public Object value()
Description copied from interface:AsyncViewRowThe value of the row index. The object can be any valid JSON object, includingJsonArrayorJsonObject.- Specified by:
valuein interfaceAsyncViewRow- Returns:
- the value.
-
document
public rx.Observable<JsonDocument> document()
Description copied from interface:AsyncViewRowLoad the underlying document, if not reduced. 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 interfaceAsyncViewRow- Returns:
- a
Observablecontaining the document once loaded.
-
document
public <D extends Document<?>> rx.Observable<D> document(Class<D> target)
Description copied from interface:AsyncViewRowLoad the underlying document, if not reduced. 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 interfaceAsyncViewRow- Parameters:
target- the target class to decode into.- Returns:
- a
Observablecontaining the document once loaded.
-
-