Interface KeyValueTable

    • Method Detail

      • fetch

        Variant fetch​(String key)
        Fetches the value stored under the provided key.
        Parameters:
        key - key associated with the value
        Returns:
        value stored under the provided key
        Throws:
        KeyNotFoundException - if no object under provided key exists
      • fetchAll

        Map<String,​Variant> fetchAll()
        Fetches all key-value pairs and returns them as a Map.
        Returns:
        all key-value pairs
      • update

        void update​(String key,
                    Variant value)
        Updates the value stored under the provided key.

        If no value is currently stored under the provided key - it will be inserted into this table.

        Parameters:
        key - key associated with the value
        value - value
      • getAllWhere

        List<Variant> getAllWhere​(Column filter)
        Returns all values from this table where the record matches the provided filter.
        Parameters:
        filter - filter for the table records
        Returns:
        values from records which match the provided filter
      • updateMany

        void updateMany​(List<String> keys,
                        String fieldName,
                        Variant fieldValue)
        Updates the provided field of the Variant value stored under the provided keys.

        If no value is currently stored under the provided key - it will be ignored.

        Parameters:
        keys - keys associated with the values
        fieldName - name of the updated value field
        fieldValue - new value for the updated field
      • updateAll

        void updateAll​(List<KeyValue> keyValues)
        Updates the key-value pairs.

        If no value is currently stored under the provided key - it will be inserted into this table.

        Parameters:
        keyValues - list of key-value pairs
      • delete

        void delete​(String key)
        Deletes the value stored under the provided key from this table.
        Parameters:
        key - key associated with the value