Interface IResourceStoreManager.IVersionedResourceStoreWithLoaderAndVersionExtractor<Key,Value>

Type Parameters:
Key - The type of the key.
Value - The type of the derived value.
All Superinterfaces:
IResourceStoreManager.IVersionedResourceStoreBase<Key,Value>, IResourceStoreManager.IVersionedResourceStoreWithLoaderBase<Key,Value>, IResourceStoreManager.IVersionedResourceStoreWithVersionExtractorBase<Key,Value>
Enclosing interface:
IResourceStoreManager

public static interface IResourceStoreManager.IVersionedResourceStoreWithLoaderAndVersionExtractor<Key,Value> extends IResourceStoreManager.IVersionedResourceStoreWithLoaderBase<Key,Value>, IResourceStoreManager.IVersionedResourceStoreWithVersionExtractorBase<Key,Value>
Same as IResourceStoreManager.IVersionedResourceStore, but with a loader and bound version extractor that do not need to be specified each time when requesting a value for a key.
Since:
8.3.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • computeIfAbsent

      Value computeIfAbsent(Key key) throws IOException
      Gets the value for the given key. The version controls whether the value is still valid. If the version obtained from the bound version extractor 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.
      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.