Interface KeyValueStore


public interface KeyValueStore
An abstraction of a store that persists the nodes of a Patricia tree.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    get(byte[] key)
    Gets the association of a key in this store.
    void
    put(byte[] key, byte[] value)
    Persists an association of a key to a value in this store.
    void
    remove(byte[] key)
    Deletes the association for the given key, that must exist in store.
  • Method Details

    • put

      void put(byte[] key, byte[] value) throws KeyValueStoreException
      Persists an association of a key to a value in this store. It replaces it if it was already present.
      Parameters:
      key - the key; this might be missing in this store, in which case nothing happens
      value - the value
      Throws:
      KeyValueStoreException - if this key/value store is not able to complete the operation
    • remove

      void remove(byte[] key) throws UnknownKeyException, KeyValueStoreException
      Deletes the association for the given key, that must exist in store.
      Parameters:
      key - the key
      Throws:
      UnknownKeyException - if key is not present in this key/value store
      KeyValueStoreException - if this key/value store is not able to complete the operation
    • get

      byte[] get(byte[] key) throws UnknownKeyException, KeyValueStoreException
      Gets the association of a key in this store.
      Parameters:
      key - the key
      Returns:
      the value associated with the key
      Throws:
      UnknownKeyException - if key is not present in this key/value store
      KeyValueStoreException - if this key/value store is not able to complete the operation