Interface IResourceStoreManager.IResourceStoreWithLoader<Key,Value>
-
- Type Parameters:
Key
- The type of the key.Value
- The type of the associated value.
- All Superinterfaces:
IResourceStoreManager.IResourceStoreBase<Key,Value>
- Enclosing interface:
- IResourceStoreManager
public static interface IResourceStoreManager.IResourceStoreWithLoader<Key,Value> extends IResourceStoreManager.IResourceStoreBase<Key,Value>
Same asIResourceStoreManager.IResourceStore
, but with a bound loader that does not need to be specified each time when requesting a value for a key.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Value
computeIfAbsent(Key key)
Gets the value for the given key.-
Methods inherited from interface de.xima.fc.common.store.versioned.IResourceStoreManager.IResourceStoreBase
computeIfAbsent, getIfPresent, remove, removeAndGetIfPresent
-
-
-
-
Method Detail
-
computeIfAbsent
Value computeIfAbsent(Key key) throws IOException
Gets the value for the given key. When the value exists already, it will be returned. If the value does not exist yet, it will be loaded 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.
-
-