Class BoundedCache<K,V>
java.lang.Object
software.amazon.awssdk.utils.cache.bounded.BoundedCache<K,V>
A thread-safe cache implementation that returns the value for a specified key, retrieving it by either getting the stored
value from the cache or using a supplied function to calculate that value and add it to the cache.
When the cache is full, batch eviction of unspecified values will be performed, with a default evictionBatchSize of 10.
The user can configure the maximum size of the cache, which is set to a default of 150.
Keys must not be null, otherwise an error will be thrown. Null values are not cached.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> BoundedCache.Builder<K, V> booleancontainsKey(K key) Get a value based on the key.intsize()
-
Method Details
-
get
Get a value based on the key. The key must not be null, otherwise an error is thrown. If the value exists in the cache, it's returned. Otherwise, the value is calculated based on the supplied functionbuilder(Function). -
size
public int size() -
containsKey
-
builder
-