Interface ValueStore

    • Method Detail

      • valueStorePut

        default <T> T valueStorePut​(Object key,
                                    T value)
        Puts a value in the value store, potentially overwriting an existing value associated with the same key.
        Parameters:
        key - The key name.
        value - value to assign to key.
        Returns:
        returns value to allow chaining calls.
        See Also:
        valueStoreGet(Object)
      • valueStoreGet

        default Object valueStoreGet​(Object key)
        Retrieves a value from the value store.
        Parameters:
        key - The entry to return, e.g., identified by a name.
        Returns:
        The value associated with key.
        See Also:
        valueStorePut(Object, Object)
      • valueStoreGet

        default Object valueStoreGet​(Object key,
                                     Object defaultValue)
        Retrieves a value from the value store. If no such value is contained in the valueStore or the value null is associated with key, the default value is returned.
        Parameters:
        key - The entry to return, e.g., identified by a name.
        defaultValue - The default value to use.
        Returns:
        The value associated with key or defaultValue if no value was associated.
        See Also:
        valueStorePut(Object, Object)
      • valueStoreUpdate

        default Object valueStoreUpdate​(Object key,
                                        Function<Object,​Object> func)
        Applies the given function to the old value associated with key (null if not existing), and stores the new, computed value in the value store.
        Parameters:
        key - The key to access.
        func - The function to apply to the old value, calculating the new one.
        Returns:
        The new value as produced by func.
      • valueStoreContains

        default boolean valueStoreContains​(Object key)
        Check for the existence of a certain key.
        Parameters:
        key - The key, usually identified by a name.
        Returns:
        Returns true, if a non-null value is associated with key.
      • valueStoreGetNumKeys

        default int valueStoreGetNumKeys()
        Returns the number of keys in this value store.
      • valueStoreGetAllKeys

        default Set<Object> valueStoreGetAllKeys()
        Returns a list of all keys contained in this value store.
      • valueStoreRemove

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

        ValueStore valueStoreImpl()
        Returns the implementation to use for adding ValueStore functionality.
      • copy

        static boolean copy​(ValueStore from,
                            ValueStore to,
                            String valueName)
        Copies a value (shallow copy) from one value store to another using the same name.