Package io.mangoo.cache
Class CacheImpl
java.lang.Object
io.mangoo.cache.CacheImpl
- All Implemented Interfaces:
Cache
- Author:
- svenkubiak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the complete cache by invalidating all entries<T> TRetrieves an object from the caches and converts it to a given classDecrements a counter with a given key If the counter did not exist, it will be created and the decrementedIncrements a cache counter with a given key If the counter did not exist, it will be created and the incrementedgetCounter(String key) Retrieves the counter for a given keyvoidAdds a value to cache with a given key overwriting and existing valuevoidAdds a complete map of objects to the cachevoidRemoves a value with a given key from the cacheresetCounter(String key) Resets the counter for a given key
-
Constructor Details
-
CacheImpl
-
-
Method Details
-
put
Description copied from interface:CacheAdds a value to cache with a given key overwriting and existing value -
remove
Description copied from interface:CacheRemoves a value with a given key from the cache -
clear
public void clear()Description copied from interface:CacheClears the complete cache by invalidating all entries -
get
Description copied from interface:CacheRetrieves an object from the caches and converts it to a given class -
putAll
Description copied from interface:CacheAdds a complete map of objects to the cache -
getAndIncrementCounter
Description copied from interface:CacheIncrements a cache counter with a given key If the counter did not exist, it will be created and the incremented- Specified by:
getAndIncrementCounterin interfaceCache- Parameters:
key- The key for the cached value- Returns:
- A counter based on AtomicInteger
-
getCounter
Description copied from interface:CacheRetrieves the counter for a given key- Specified by:
getCounterin interfaceCache- Parameters:
key- The key for the counter- Returns:
- A counter based on AtomicInteger or null if none found
-
resetCounter
Description copied from interface:CacheResets the counter for a given key- Specified by:
resetCounterin interfaceCache- Parameters:
key- The key for the counter- Returns:
- A counter based on AtomicInteger
-
getAndDecrementCounter
Description copied from interface:CacheDecrements a counter with a given key If the counter did not exist, it will be created and the decremented- Specified by:
getAndDecrementCounterin interfaceCache- Parameters:
key- The key for the cached value- Returns:
- A counter based on AtomicInteger
-