private static final class ResponseMetadataCache.InternalCache extends java.util.LinkedHashMap<java.lang.Integer,ResponseMetadata>
removeEldestEntry
method to turn LinkedHashMap into a
LRU(ish) cache that automatically evicts old entries.Modifier and Type | Field and Description |
---|---|
private int |
maxSize |
private static long |
serialVersionUID |
Constructor and Description |
---|
InternalCache(int maxSize) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
removeEldestEntry(java.util.Map.Entry<java.lang.Integer,ResponseMetadata> eldest) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
private static final long serialVersionUID
private int maxSize
protected boolean removeEldestEntry(java.util.Map.Entry<java.lang.Integer,ResponseMetadata> eldest)
removeEldestEntry
in class java.util.LinkedHashMap<java.lang.Integer,ResponseMetadata>