public interface CacheDef<K,V>
Modifier and Type | Method and Description |
---|---|
String |
configKey()
Key to use when looking up configuration for this cache.
|
Duration |
expireAfterWrite() |
Duration |
expireFromMemoryAfterAccess() |
com.google.inject.TypeLiteral<K> |
keyType() |
com.google.common.cache.CacheLoader<K,V> |
loader() |
long |
maximumWeight() |
String |
name()
Unique name for this cache.
|
com.google.inject.TypeLiteral<V> |
valueType() |
com.google.common.cache.Weigher<K,V> |
weigher() |
String name()
The name can be used in a binding annotation @Named(name)
to inject the cache
configured with this binding.
String configKey()
Typically, this will match the result of name()
, so that configuration is keyed by
the actual cache name. However, it may be changed, for example to reuse the size limits of some
other cache.
com.google.inject.TypeLiteral<K> keyType()
com.google.inject.TypeLiteral<V> valueType()
long maximumWeight()
Duration expireAfterWrite()
Duration expireFromMemoryAfterAccess()