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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void filter​(java.lang.String key, IKVFilter filter)
      Allows to apply a filter to the value of a specific key.
      void filter​(java.util.Map<java.lang.String,​IKVFilter> filterMap)
      Enables filtering values of multiple keys.
      java.lang.Boolean getAsBoolean​(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.Byte getAsByte​(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.Double getAsDouble​(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.File getAsFile​(java.lang.String key)
      Returns a value as a File object.
      java.lang.Integer getAsInt​(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.Long getAsLong​(java.lang.String key)
      Returns a value as long for the given key.
      <T> T getAsObject​(java.lang.String key, java.lang.Class<T> objectClass)
      Returns a value as object for the given key.
      java.lang.Short getAsShort​(java.lang.String key)
      Returns a value as short for the given key.
      java.lang.String getAsString​(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.
      boolean isNull​(java.lang.String key)
      Checks whether the value for the requested key is null.
      boolean matches​(java.util.Map<java.lang.String,​java.lang.String> selection)
      Checks whether particular keys have matching values according to selection.
      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.
      void prefixAllKeys​(java.lang.String prefix)
      Updates all keys of this key value store and prepends the given prefix.
      void project​(java.lang.String[] filterKeys)
      Reduces the key value store such that it only contains the given keys.
      void removeAll​(java.lang.String[] removeKeys)
      Removes all the keys provided by removeKeys.
      void renameKey​(java.lang.String key, java.lang.String newKeyName)
      Renames a key by the new key name.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • 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.NoSuchMethodException
        Returns 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.InstantiationException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        java.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 to selection.
        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 a filter to the value of a specific key.
        Parameters:
        key - Key to whose value the filter may be applied.
        filter - The filter for applying to the value of the given key.
      • 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 by removeKeys.
        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.