org.nnsoft.sameas4j.cache
Class InMemoryCache
java.lang.Object
org.nnsoft.sameas4j.cache.InMemoryCache
- All Implemented Interfaces:
- Cache
public final class InMemoryCache
- extends Object
- implements Cache
An in-memory based Cache implementation.
|
Method Summary |
|
get(CacheKey cacheKey,
Class<T> type)
Retrieves an object from the cache. |
|
put(CacheKey cacheKey,
T cacheValue)
Add a new entry in the cache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InMemoryCache
public InMemoryCache()
get
public <T> T get(CacheKey cacheKey,
Class<T> type)
- Retrieves an object from the cache.
- Specified by:
get in interface Cache
- Type Parameters:
T - The stored object type- Parameters:
cacheKey - The cache keytype - The stored object
- Returns:
- The stored object if any, null otherwise
put
public <T> void put(CacheKey cacheKey,
T cacheValue)
- Add a new entry in the cache.
- Specified by:
put in interface Cache
- Type Parameters:
T - The stored object type- Parameters:
cacheKey - The cache keycacheValue - The stored object
Copyright © 2009-2012 99 Software Foundation. All Rights Reserved.