Package com.atlassian.cache
Interface CacheLoader<K,V>
- Type Parameters:
K- the type of key used by the cacheV- the type of value stored in the cache
@PublicSpi
public interface CacheLoader<K,V>
Populates a cache, for example lazily upon a miss.
- Since:
- 2.0
-
Method Summary
-
Method Details
-
load
Loads the value for the given key.- Parameters:
key- the key for which to load the value (required)- Returns:
- a non-null value; if null values are possible, e.g. when the key is a database ID that does not
actually exist, declare the loader's value type to be a wrapper type such as Guava's
Option<Foo>class
-