Interface DataStore<V extends Serializable>

  • Type Parameters:
    V - serializable type of the mapped value
    All Known Implementing Classes:
    AbstractDataStore


    public interface DataStore<V extends Serializable>
    Stores and manages serializable data of a specific type, where the key is a string and the value is a Serializable object.

    null keys or values are not allowed. Implementation should be thread-safe.

    Since:
    1.16
    • Method Summary

      Modifier and Type Method and Description
      DataStore<V> clear()
      Deletes all of the stored keys and values.
      boolean containsKey(String key)
      Returns whether the store contains the given key.
      boolean containsValue(V value)
      Returns whether the store contains the given value.
      DataStore<V> delete(String key)
      Deletes the stored key and value based on the given key, or ignored if the key doesn't already exist.
      V get(String key)
      Returns the stored value for the given key or null if not found.
      DataStoreFactory getDataStoreFactory()
      Returns the data store factory.
      String getId()
      Returns the data store ID.
      boolean isEmpty()
      Returns whether there are any stored keys.
      Set<String> keySet()
      Returns the unmodifiable set of all stored keys.
      DataStore<V> set(String key, V value)
      Stores the given value for the given key (replacing any existing value).
      int size()
      Returns the number of stored keys.
      Collection<V> values()
      Returns the unmodifiable collection of all stored values.