Package com.github.loki4j.client.util
Class Cache.BoundAtomicMapCache<K,V>
- java.lang.Object
-
- com.github.loki4j.client.util.Cache.BoundAtomicMapCache<K,V>
-
- All Implemented Interfaces:
Cache<K,V>
public static class Cache.BoundAtomicMapCache<K,V> extends java.lang.Object implements Cache<K,V>
Simple cache implementation based on atomic reference on bound hash map. Cache grows up to the given limit. When it reaches the limit, it's being truncated to zero. Then it starts the next cycle of accumulating key-values until the limit is reached again.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.loki4j.client.util.Cache
Cache.BoundAtomicMapCache<K,V>
-
-
Constructor Summary
Constructors Constructor Description BoundAtomicMapCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vget(K key, java.util.function.Supplier<V> onMiss)Get the value from cache based by key.voidsetMaxCachedItems(int maxCachedItems)
-