Class ValueStoreImpl

  • All Implemented Interfaces:
    ValueStore, Cloneable

    public class ValueStoreImpl
    extends Object
    implements ValueStore, Cloneable
    Implementation of the ValueStore interface backed by a simple HashMap. This class can be used to implement ValueStore functionality on behalf of a host object.
    • Constructor Detail

      • ValueStoreImpl

        public ValueStoreImpl()
    • Method Detail

      • valueStorePut

        public <T> T valueStorePut​(Object key,
                                   T value)
        Offers a simple get/put-mechanism to store and retrieve information as a kind of global data store. This can be used as a simple extension mechanism.
        Specified by:
        valueStorePut in interface ValueStore
        Parameters:
        key - The key name.
        value - value to assign to key. Mustn't be null (otherwise a NullPointerException is thrown).
        Returns:
        returns value
        See Also:
        valueStoreGet(Object)
      • valueStoreGetNumKeys

        public int valueStoreGetNumKeys()
        Returns the number of keys in this value store.
        Specified by:
        valueStoreGetNumKeys in interface ValueStore
      • valueStoreRemove

        public Object valueStoreRemove​(Object key)
        Removes an entry from this value store.
        Specified by:
        valueStoreRemove in interface ValueStore
        Returns:
        The value previously associated with "key", or null, if no such key was found.
      • valueStoreImpl

        public ValueStore valueStoreImpl()
        Description copied from interface: ValueStore
        Returns the implementation to use for adding ValueStore functionality.
        Specified by:
        valueStoreImpl in interface ValueStore