|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KeyValueStoreOperations
Generic abstraction for Key/Value stores. Contains most operations that generic K/V stores might expose.
Method Summary | ||
---|---|---|
|
containsKey(K key)
Does the store contain this key? |
|
|
deleteKeys(K... keys)
Delete one or more keys from the store. |
|
|
get(K key)
Get a value at the specified key, trying to infer the type from either the bucket in which the value was stored, or (by default) as a java.util.Map . |
|
|
getAndSet(K key,
V value)
Get the old value at the specified key and replace it with the given value. |
|
|
getAndSetAsBytes(K key,
byte[] value)
Get the old value at the specified key as a byte array and replace it with the given bytes. |
|
|
getAndSetAsType(K key,
V value,
Class<T> requiredType)
Get the old value at the specified key and replace it with the given value, converting it to an instance of the given type. |
|
|
getAsBytes(K key)
Get the value at the specified key as a byte array. |
|
|
getAsType(K key,
Class<T> requiredType)
Get the value at the specified key and convert it into an instance of the specified type. |
|
|
getBucketSchema(B bucket)
Get the properties of the specified bucket. |
|
|
getBucketSchema(B bucket,
boolean listKeys)
Get the properties of the bucket and specify whether or not to list the keys in that bucket. |
|
|
getValues(K... keys)
Variation on getValues(java.util.List) that uses varargs
instead of a java.util.List . |
|
|
getValues(List<K> keys)
Get all the values at the specified keys. |
|
|
getValuesAsType(Class<T> requiredType,
K... keys)
A variation on getValuesAsType(java.util.List, Class) that
takes uses varargs instead of a java.util.List . |
|
|
getValuesAsType(List<K> keys,
Class<T> requiredType)
Get all the values at the specified keys, converting the values into instances of the specified type. |
|
|
set(K key,
V value)
Set a value at a specified key. |
|
|
set(K key,
V value,
QosParameters qosParams)
Variation on set() that allows the user to specify QosParameters . |
|
|
setAsBytes(K key,
byte[] value)
Set a value as a byte array at a specified key. |
|
|
setAsBytes(K key,
byte[] value,
QosParameters qosParams)
|
|
|
setIfKeyNonExistent(K key,
V value)
Set the value at the given key only if that key doesn't already exist. |
|
|
setIfKeyNonExistentAsBytes(K key,
byte[] value)
Set the value at the given key as a byte array only if that key doesn't already exist. |
|
|
setMultiple(Map<K,V> keysAndValues)
Convenience method to set multiple values as Key/Value pairs. |
|
|
setMultipleAsBytes(Map<K,byte[]> keysAndValues)
Convenience method to set multiple values as Key/byte[] pairs. |
|
|
setMultipleAsBytesIfKeysNonExistent(Map<K,byte[]> keysAndValues)
Variation on setting multiple values as byte arrays only if the key doesn't already exist. |
|
|
setMultipleIfKeysNonExistent(Map<K,V> keysAndValues)
Variation on setting multiple values only if the key doesn't already exist. |
|
|
setWithMetaData(K key,
V value,
Map<String,String> metaData)
|
|
|
setWithMetaData(K key,
V value,
Map<String,String> metaData,
QosParameters qosParams)
Variation on setWithMetaData() that allows the user to pass QosParameters . |
|
|
updateBucketSchema(B bucket,
Map<String,Object> props)
|
Method Detail |
---|
<K,V> KeyValueStoreOperations set(K key, V value)
key
- value
-
<K,V> KeyValueStoreOperations set(K key, V value, QosParameters qosParams)
QosParameters
.
K
- V
- key
- value
- qosParams
-
<K> KeyValueStoreOperations setAsBytes(K key, byte[] value)
key
- value
-
<K,V> KeyValueStoreOperations setWithMetaData(K key, V value, Map<String,String> metaData, QosParameters qosParams)
QosParameters
.
K
- V
- key
- value
- metaData
- qosParams
-
<K,V> V get(K key)
java.util.Map
.
key
-
null
if not found.<K> byte[] getAsBytes(K key)
key
-
null
if not found.<K,T> T getAsType(K key, Class<T> requiredType)
key
- requiredType
-
null
if not found.<K,V> V getAndSet(K key, V value)
key
- value
-
<K> byte[] getAndSetAsBytes(K key, byte[] value)
key
- value
-
<K,V,T> T getAndSetAsType(K key, V value, Class<T> requiredType)
key
- value
- requiredType
- The type to convert the value to.
<K,V> List<V> getValues(List<K> keys)
keys
-
<K,V> List<V> getValues(K... keys)
getValues(java.util.List)
that uses varargs
instead of a java.util.List
.
keys
-
<K,T> List<T> getValuesAsType(List<K> keys, Class<T> requiredType)
keys
- requiredType
-
<T,K> List<T> getValuesAsType(Class<T> requiredType, K... keys)
getValuesAsType(java.util.List, Class)
that
takes uses varargs instead of a java.util.List
.
requiredType
- keys
-
<K,V> KeyValueStoreOperations setIfKeyNonExistent(K key, V value)
key
- value
-
<K> KeyValueStoreOperations setIfKeyNonExistentAsBytes(K key, byte[] value)
key
- value
-
<K,V> KeyValueStoreOperations setMultiple(Map<K,V> keysAndValues)
keysAndValues
-
<K> KeyValueStoreOperations setMultipleAsBytes(Map<K,byte[]> keysAndValues)
keysAndValues
-
<K,V> KeyValueStoreOperations setMultipleIfKeysNonExistent(Map<K,V> keysAndValues)
keysAndValues
-
<K> KeyValueStoreOperations setMultipleAsBytesIfKeysNonExistent(Map<K,byte[]> keysAndValues)
K
- keysAndValues
-
<K> boolean containsKey(K key)
key
-
true
if the key exists, false
otherwise.<K> boolean deleteKeys(K... keys)
keys
-
true
if all keys were successfully deleted, false
otherwise.<B> Map<String,Object> getBucketSchema(B bucket)
bucket
-
<B> KeyValueStoreOperations updateBucketSchema(B bucket, Map<String,Object> props)
<B> Map<String,Object> getBucketSchema(B bucket, boolean listKeys)
bucket
- listKeys
-
<K> KeyValueStoreOperations setAsBytes(K key, byte[] value, QosParameters qosParams)
<K,V> KeyValueStoreOperations setWithMetaData(K key, V value, Map<String,String> metaData)
|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |