KEYTYPE - Cache key typeVALUETYPE - Cache value type@ThreadSafe public class CacheWithConversion<KEYTYPE,VALUETYPE> extends AbstractCache<KEYTYPE,VALUETYPE>
m_aCacheAccessStats, m_aRWLock, STATISTICS_PREFIX| Constructor and Description |
|---|
CacheWithConversion(int nMaxSize,
String sCacheName) |
CacheWithConversion(String sCacheName) |
| Modifier and Type | Method and Description |
|---|---|
VALUETYPE |
getFromCache(KEYTYPE aKey,
IConverter<KEYTYPE,VALUETYPE> aValueRetriever)
Get the value from the cache.
|
clearCache, createCache, getFromCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getFromCacheNotLocked, getMaxSize, getName, getSize, hasMaxSize, isEmpty, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, toStringpublic CacheWithConversion(@CheckForSigned int nMaxSize, @Nonnull String sCacheName)
@Nonnull public final VALUETYPE getFromCache(@Nonnull KEYTYPE aKey, @Nonnull IConverter<KEYTYPE,VALUETYPE> aValueRetriever)
aKey - The key of the cached object. May not be null.aValueRetriever - The converter to be used to retrieve the object to cache. May not be
null. This converter may not return null
objects to cache!null.Copyright © 2014–2015 Philip Helger. All rights reserved.