com.atlassian.cache
Interface CacheLoader<K,V>

Type Parameters:
K - the type of key used by the cache
V - 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
 V load(K key)
          Loads the value for the given key.
 

Method Detail

load

@NotNull
V load(@NotNull
               K key)
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


Copyright © 2014 Atlassian. All Rights Reserved.