public class KvListResource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected OrchestrateClient |
client
The Orchestrate client to make requests with.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper
The object mapper used to deserialize JSON responses.
|
| Modifier and Type | Method and Description |
|---|---|
<T> OrchestrateRequest<KvList<T>> |
get(java.lang.Class<T> clazz)
Fetch a paginated, lexicographically ordered list of items contained in a
collection.
|
KvListResource |
inclusive()
Add the 'startKey' to the result set, equivalent to:
|
KvListResource |
inclusive(boolean inclusive)
If
inclusive is true the 'startKey' will be included in
the result set. |
KvListResource |
limit(int limit)
The number of results to return.
|
KvListResource |
startKey(java.lang.String startKey)
The start of the key range to paginate from including the specified value
if it exists.
|
protected <T> T |
toDomainObject(java.lang.String rawValue,
java.lang.Class<T> clazz) |
protected byte[] |
toJsonBytes(java.lang.Object value) |
protected com.fasterxml.jackson.databind.JsonNode |
toJsonNode(org.glassfish.grizzly.http.HttpContent response) |
protected <T> KvObject<T> |
toKvObject(org.glassfish.grizzly.http.HttpContent response,
java.lang.String collection,
java.lang.String key,
java.lang.Class<T> clazz) |
protected <T> KvObject<T> |
toKvObject(com.fasterxml.jackson.databind.JsonNode result,
java.lang.Class<T> clazz) |
protected final OrchestrateClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public <T> OrchestrateRequest<KvList<T>> get(@NonNull java.lang.Class<T> clazz)
Usage:
KvList<String> objects =
client.listCollection("someCollection")
.limit(10)
.get(String.class)
.get();
T - The type to deserialize the result of the request to.clazz - Type information for marshalling objects at runtime.public KvListResource inclusive()
this.inclusive(Boolean.TRUE);
inclusive(boolean)public KvListResource inclusive(boolean inclusive)
inclusive is true the 'startKey' will be included in
the result set.inclusive - Whether to include the 'startKey' in the result set.public KvListResource limit(int limit)
limit - The number of KV objects to retrieve.public KvListResource startKey(java.lang.String startKey)
startKey - The start of the key range to paginate from.protected byte[] toJsonBytes(java.lang.Object value)
protected com.fasterxml.jackson.databind.JsonNode toJsonNode(org.glassfish.grizzly.http.HttpContent response)
throws java.io.IOException
java.io.IOExceptionprotected <T> KvObject<T> toKvObject(com.fasterxml.jackson.databind.JsonNode result, java.lang.Class<T> clazz) throws java.io.IOException
java.io.IOExceptionprotected <T> KvObject<T> toKvObject(org.glassfish.grizzly.http.HttpContent response, java.lang.String collection, java.lang.String key, java.lang.Class<T> clazz) throws java.io.IOException
java.io.IOExceptionprotected <T> T toDomainObject(java.lang.String rawValue,
java.lang.Class<T> clazz)
throws java.io.IOException
java.io.IOException