Package dev.voidframework.cache.engine
Class MemoryCacheEngine
java.lang.Object
dev.voidframework.cache.engine.AbstractCacheEngine
dev.voidframework.cache.engine.MemoryCacheEngine
- All Implemented Interfaces:
CacheEngine
In-memory cache implementation.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.voidframework.cache.engine.AbstractCacheEngine
AbstractCacheEngine.CachedElement -
Constructor Summary
ConstructorsConstructorDescriptionMemoryCacheEngine(com.typesafe.config.Config configuration) Build a new instance. -
Method Summary
Methods inherited from class dev.voidframework.cache.engine.AbstractCacheEngine
unwrap, wrap
-
Constructor Details
-
MemoryCacheEngine
@Inject public MemoryCacheEngine(com.typesafe.config.Config configuration) Build a new instance.- Parameters:
configuration- The application configuration- Since:
- 1.0.0
-
-
Method Details
-
get
Description copied from interface:CacheEngineRetrieves a value from cache.- Parameters:
cacheKey- The key- Returns:
- The value, otherwise,
null
-
set
Description copied from interface:CacheEngineSets a value to the cache.- Parameters:
cacheKey- The keyvalue- The valuetimeToLive- Retention time (in seconds)
-
remove
Description copied from interface:CacheEngineRemoves a value from cache.- Parameters:
cacheKey- The key
-