public class KvListResource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected OrchestrateClient |
client
The Orchestrate client to make requests with.
|
protected JacksonMapper |
jacksonMapper |
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()
Deprecated.
Use startKey(String, boolean)
|
KvListResource |
inclusive(boolean inclusive)
Deprecated.
Use startKey(String, boolean)
|
KvListResource |
limit(int limit)
The number of results to return.
|
KvListResource |
startKey(java.lang.String startKey)
The start (non-inclusive) of the key range to paginate from including the specified value
if it exists.
|
KvListResource |
startKey(java.lang.String startKey,
boolean inclusive)
The start of the key range to paginate from including the specified value
if it exists.
|
KvListResource |
stopKey(java.lang.String stopKey)
The end (non-inclusive) of the key range to paginate from including the specified value
if it exists.
|
KvListResource |
stopKey(java.lang.String stopKey,
boolean inclusive)
The end of the key range to paginate from including the specified value
if it exists.
|
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) |
KvListResource |
withValues(boolean withValues)
If
withValues is true then the KV objects being listed
will be retrieved with their values. |
protected final OrchestrateClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
protected final JacksonMapper jacksonMapper
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.public KvListResource startKey(java.lang.String startKey, boolean inclusive)
startKey - The start of the key range to paginate from.public KvListResource stopKey(java.lang.String stopKey)
stopKey - The end of the key range to paginate from.public KvListResource stopKey(java.lang.String stopKey, boolean inclusive)
stopKey - The end of the key range to paginate from.inclusive - true to include the specified key in the results, false to stop just before it.public KvListResource withValues(boolean withValues)
withValues is true then the KV objects being listed
will be retrieved with their values. Defaults to true.withValues - The setting for whether to retrieve KV values.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.IOException