public interface CacheBinding<K,V>
CacheModule
instance.Modifier and Type | Method and Description |
---|---|
CacheBinding<K,V> |
configKey(String configKey)
Set the config name to something other than the cache name.
|
CacheBinding<K,V> |
expireAfterWrite(Duration duration)
Set the time an element lives after last write before being expired.
|
CacheBinding<K,V> |
expireFromMemoryAfterAccess(Duration duration)
Set the time an element lives after last access before being expired.
|
CacheBinding<K,V> |
loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
Populate the cache with items from the CacheLoader.
|
CacheBinding<K,V> |
maximumWeight(long weight)
Set the total size of the cache.
|
CacheBinding<K,V> |
weigher(Class<? extends com.google.common.cache.Weigher<K,V>> clazz)
Algorithm to weigh an object with a method other than the unit weight 1.
|
CacheBinding<K,V> maximumWeight(long weight)
CacheBinding<K,V> expireAfterWrite(Duration duration)
CacheBinding<K,V> expireFromMemoryAfterAccess(Duration duration)
CacheBinding<K,V> loader(Class<? extends com.google.common.cache.CacheLoader<K,V>> clazz)
CacheBinding<K,V> weigher(Class<? extends com.google.common.cache.Weigher<K,V>> clazz)
CacheBinding<K,V> configKey(String configKey)
CacheDef.configKey()