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.String
id()
The id of the document, if not reduced.Object
key()
The key of the row index.String
toString()
Object
value()
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:AsyncViewRow
The id of the document, if not reduced.- Specified by:
id
in interfaceAsyncViewRow
- Returns:
- the id of the document.
-
key
public Object key()
Description copied from interface:AsyncViewRow
The key of the row index. The object can be any valid JSON object, includingJsonArray
orJsonObject
.- Specified by:
key
in interfaceAsyncViewRow
- Returns:
- the key.
-
value
public Object value()
Description copied from interface:AsyncViewRow
The value of the row index. The object can be any valid JSON object, includingJsonArray
orJsonObject
.- Specified by:
value
in interfaceAsyncViewRow
- Returns:
- the value.
-
document
public rx.Observable<JsonDocument> document()
Description copied from interface:AsyncViewRow
Load the underlying document, if not reduced. 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 interfaceAsyncViewRow
- Returns:
- a
Observable
containing the document once loaded.
-
document
public <D extends Document<?>> rx.Observable<D> document(Class<D> target)
Description copied from interface:AsyncViewRow
Load the underlying document, if not reduced. 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 interfaceAsyncViewRow
- Parameters:
target
- the target class to decode into.- Returns:
- a
Observable
containing the document once loaded.
-
-