public class LookupInResult extends Object
Modifier and Type | Method and Description |
---|---|
long |
cas()
Returns the CAS value of document at the time of loading.
|
<T> T |
contentAs(int index,
Class<T> target)
Decodes the content at the given index into an instance of the target class.
|
<T> T |
contentAs(int index,
TypeRef<T> target)
Decodes the content at the given index into an instance of the target type.
|
JsonArray |
contentAsArray(int index)
Decodes the encoded content at the given index into a
JsonArray . |
JsonObject |
contentAsObject(int index)
Decodes the encoded content at the given index into a
JsonObject . |
boolean |
equals(Object o) |
boolean |
exists(int index)
Allows to check if a value at the given index exists.
|
int |
hashCode() |
boolean |
isDeleted()
Returns whether this document was deleted (a tombstone).
|
String |
toString() |
public long cas()
The CAS value is an opaque identifier which is associated with a specific state of the document on the server. It can be used during a subsequent mutation to make sure that the document has not been modified in the meantime.
If document on the server has been modified in the meantime the SDK will raise a CasMismatchException
. In
this case the caller is expected to re-do the whole "fetch-modify-update" cycle again. Please refer to the
SDK documentation for more information on CAS mismatches and subsequent retries.
public <T> T contentAs(int index, Class<T> target)
index
- the index of the subdoc value to decode.target
- the target type to decode into.public <T> T contentAs(int index, TypeRef<T> target)
index
- the index of the subdoc value to decode.target
- the target type to decode into.public JsonObject contentAsObject(int index)
JsonObject
.index
- the index at which to decode.public JsonArray contentAsArray(int index)
JsonArray
.index
- the index at which to decode.public boolean exists(int index)
index
- the index at which to check.@Stability.Internal public boolean isDeleted()
Will always be false unless LookupInOptions.accessDeleted(boolean)
has been set.
For internal use only: applications should not require it.
Copyright © 2021 Couchbase, Inc.. All rights reserved.