Package com.couchbase.client.java.kv
Class LookupInResult
- java.lang.Object
-
- com.couchbase.client.java.kv.LookupInResult
-
public class LookupInResult extends Object
This result is returned from successful KeyValue subdocument lookup responses.- Since:
- 3.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
cas()
Returns the CAS value of the document.<T> T
contentAs(int index, TypeRef<T> target)
Decodes the content at the given index into an instance of the target type.<T> T
contentAs(int index, Class<T> target)
Decodes the content at the given index into an instance of the target class.JsonArray
contentAsArray(int index)
Decodes the encoded content at the given index into aJsonArray
.JsonObject
contentAsObject(int index)
Decodes the encoded content at the given index into aJsonObject
.boolean
equals(Object o)
boolean
exists(int index)
Allows to check if a value at the given index exists.int
hashCode()
String
toString()
-
-
-
Method Detail
-
cas
public long cas()
Returns the CAS value of the document.
-
contentAs
public <T> T contentAs(int index, Class<T> target)
Decodes the content at the given index into an instance of the target class.- Parameters:
index
- the index of the subdoc value to decode.target
- the target type to decode into.- Returns:
- the decoded content into the generic type requested.
-
contentAs
public <T> T contentAs(int index, TypeRef<T> target)
Decodes the content at the given index into an instance of the target type.- Parameters:
index
- the index of the subdoc value to decode.target
- the target type to decode into.- Returns:
- the decoded content into the generic type requested.
-
contentAsObject
public JsonObject contentAsObject(int index)
Decodes the encoded content at the given index into aJsonObject
.- Parameters:
index
- the index at which to decode.
-
contentAsArray
public JsonArray contentAsArray(int index)
Decodes the encoded content at the given index into aJsonArray
.- Parameters:
index
- the index at which to decode.
-
exists
public boolean exists(int index)
Allows to check if a value at the given index exists.- Parameters:
index
- the index at which to check.- Returns:
- true if a value is present at the index, false otherwise.
-
-