Interface IKVStore
-
- All Superinterfaces:
java.util.Map<java.lang.String,java.lang.Object>
public interface IKVStore extends java.util.Map<java.lang.String,java.lang.Object>Generic interface of KVStores allowing convenient access to the data contained.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfilter(java.lang.String key, IKVFilter filter)Allows to apply afilterto the value of a specifickey.voidfilter(java.util.Map<java.lang.String,IKVFilter> filterMap)Enables filtering values of multiple keys.java.lang.BooleangetAsBoolean(java.lang.String key)Returns a value as boolean for the given key.java.util.List<java.lang.Boolean>getAsBooleanList(java.lang.String key)Returns a value as boolean list for the given key.java.util.List<java.lang.Boolean>getAsBooleanList(java.lang.String key, java.lang.String separator)Returns a value as boolean list for the given key.java.lang.BytegetAsByte(java.lang.String key)Returns a value as byte for the given key.byte[]getAsBytes(java.lang.String columnClassifierObject)Returns a value as byte array for the given key.java.lang.DoublegetAsDouble(java.lang.String key)Returns a value as double for the given key.java.util.List<java.lang.Double>getAsDoubleList(java.lang.String key)Returns a value as double list for the given key.java.util.List<java.lang.Double>getAsDoubleList(java.lang.String key, java.lang.String separator)Returns a value as double list for the given key.java.io.FilegetAsFile(java.lang.String key)Returns a value as a File object.java.lang.IntegergetAsInt(java.lang.String key)Returns a value as integer for the given key.java.util.List<java.lang.Integer>getAsIntList(java.lang.String key)Returns a value as integer list for the given key.java.util.List<java.lang.Integer>getAsIntList(java.lang.String key, java.lang.String separator)Returns a value as integer list for the given key.java.lang.LonggetAsLong(java.lang.String key)Returns a value as long for the given key.<T> TgetAsObject(java.lang.String key, java.lang.Class<T> objectClass)Returns a value as object for the given key.java.lang.ShortgetAsShort(java.lang.String key)Returns a value as short for the given key.java.lang.StringgetAsString(java.lang.String key)Returns a value as string for the given key.java.util.List<java.lang.String>getAsStringList(java.lang.String key)Returns a value as string list for the given key.java.util.List<java.lang.String>getAsStringList(java.lang.String key, java.lang.String separator)Returns a value as string list for the given key.booleanisNull(java.lang.String key)Checks whether the value for the requested key is null.booleanmatches(java.util.Map<java.lang.String,java.lang.String> selection)Checks whether particular keys have matching values according toselection.voidmerge(java.lang.String[] fieldKeys, java.lang.String separator, java.lang.String newKey)Merges a set of keys and concatenates the values of the respective keys.voidprefixAllKeys(java.lang.String prefix)Updates all keys of this key value store and prepends the given prefix.voidproject(java.lang.String[] filterKeys)Reduces the key value store such that it only contains the given keys.voidremoveAll(java.lang.String[] removeKeys)Removes all the keys provided byremoveKeys.voidrenameKey(java.lang.String key, java.lang.String newKeyName)Renames a key by the new key name.
-
-
-
Method Detail
-
getAsString
java.lang.String getAsString(java.lang.String key)
Returns a value as string for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsBoolean
java.lang.Boolean getAsBoolean(java.lang.String key)
Returns a value as boolean for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsInt
java.lang.Integer getAsInt(java.lang.String key)
Returns a value as integer for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsDouble
java.lang.Double getAsDouble(java.lang.String key)
Returns a value as double for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsLong
java.lang.Long getAsLong(java.lang.String key)
Returns a value as long for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsShort
java.lang.Short getAsShort(java.lang.String key)
Returns a value as short for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsByte
java.lang.Byte getAsByte(java.lang.String key)
Returns a value as byte for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsObject
<T> T getAsObject(java.lang.String key, java.lang.Class<T> objectClass) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodExceptionReturns a value as object for the given key.- Parameters:
key- Key for which the value shall be returned.objectClass- The class object for which a concrete object is to be returned.- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodException
-
getAsBytes
byte[] getAsBytes(java.lang.String columnClassifierObject)
Returns a value as byte array for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsDoubleList
java.util.List<java.lang.Double> getAsDoubleList(java.lang.String key)
Returns a value as double list for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsDoubleList
java.util.List<java.lang.Double> getAsDoubleList(java.lang.String key, java.lang.String separator)Returns a value as double list for the given key.- Parameters:
key- Key for which the value shall be returned.separator- Separator dividing the entries of the list.
-
getAsIntList
java.util.List<java.lang.Integer> getAsIntList(java.lang.String key)
Returns a value as integer list for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsIntList
java.util.List<java.lang.Integer> getAsIntList(java.lang.String key, java.lang.String separator)Returns a value as integer list for the given key.- Parameters:
key- Key for which the value shall be returned.separator- Separator dividing the entries of the list.
-
getAsStringList
java.util.List<java.lang.String> getAsStringList(java.lang.String key)
Returns a value as string list for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsStringList
java.util.List<java.lang.String> getAsStringList(java.lang.String key, java.lang.String separator)Returns a value as string list for the given key.- Parameters:
key- Key for which the value shall be returned.separator- Separator dividing the entries of the list.
-
getAsBooleanList
java.util.List<java.lang.Boolean> getAsBooleanList(java.lang.String key)
Returns a value as boolean list for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsBooleanList
java.util.List<java.lang.Boolean> getAsBooleanList(java.lang.String key, java.lang.String separator)Returns a value as boolean list for the given key.- Parameters:
key- Key for which the value shall be returned.
-
getAsFile
java.io.File getAsFile(java.lang.String key)
Returns a value as a File object.- Parameters:
key- Key for which the value shall be returned.- Returns:
- The value for the given key as a file.
-
matches
boolean matches(java.util.Map<java.lang.String,java.lang.String> selection)
Checks whether particular keys have matching values according toselection.- Parameters:
selection- Map of keys and values to match for. Values may use * as a wildcard.- Returns:
- Returns true whether this key value star meets the keys and values in
selection.
-
merge
void merge(java.lang.String[] fieldKeys, java.lang.String separator, java.lang.String newKey)Merges a set of keys and concatenates the values of the respective keys.- Parameters:
fieldKeys- Keys of values to be concatenated.separator- Seperator to separate values of different keys.newKey- Name of the new key.
-
project
void project(java.lang.String[] filterKeys)
Reduces the key value store such that it only contains the given keys.- Parameters:
filterKeys- Keys to keep in the key value store.
-
filter
void filter(java.lang.String key, IKVFilter filter)Allows to apply afilterto the value of a specifickey.- Parameters:
key- Key to whose value the filter may be applied.filter- The filter for applying to the value of the givenkey.
-
filter
void filter(java.util.Map<java.lang.String,IKVFilter> filterMap)
Enables filtering values of multiple keys.- Parameters:
filterMap- Map of keys and respective filters to apply.
-
renameKey
void renameKey(java.lang.String key, java.lang.String newKeyName)Renames a key by the new key name.- Parameters:
key- The old key name.newKeyName- The new key name.
-
prefixAllKeys
void prefixAllKeys(java.lang.String prefix)
Updates all keys of this key value store and prepends the given prefix.- Parameters:
prefix- The prefix to prepend to key names.
-
removeAll
void removeAll(java.lang.String[] removeKeys)
Removes all the keys provided byremoveKeys.- Parameters:
removeKeys- Array of keys that shall be removed from the key value store.
-
isNull
boolean isNull(java.lang.String key)
Checks whether the value for the requested key is null.- Parameters:
key- The key for which the value is to be checked.- Returns:
- True iff the value is null.
-
-