Interface IResourceStoreManager.IVersionedResourceStoreWithLoaderBase<Key,Value>

Type Parameters:
Key - The type of the key.
Value - The type of the derived value.
All Superinterfaces:
IResourceStoreManager.IVersionedResourceStoreBase<Key,Value>
All Known Subinterfaces:
IResourceStoreManager.IVersionedResourceStoreWithLoader<Key,Value>, IResourceStoreManager.IVersionedResourceStoreWithLoaderAndVersionExtractor<Key,Value>
Enclosing interface:
IResourceStoreManager

public static interface IResourceStoreManager.IVersionedResourceStoreWithLoaderBase<Key,Value> extends IResourceStoreManager.IVersionedResourceStoreBase<Key,Value>
Same as IResourceStoreManager.IVersionedResourceStore, but with a bound loader that does not need to be specified each time when requesting a value for a key.

You can also bind a version extractor, so that you do not have to specify the version each time you wish to obtain a value for a key.

Since:
8.3.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • computeIfAbsent

      Value computeIfAbsent(Key key, Object version) throws IOException
      Gets the value for the given key. The version controls whether the value is still valid. If the version is different from the stored version of the file, the value is considered stale. Stales values are discarded and reloaded using the bound loader.
      Parameters:
      key - The key for which to get the value.
      version - The version of key.
      Returns:
      The associated value, either from the store if still fresh, or obtained from the bound loader.
      Throws:
      IOException - If the loader throws an exception.