
com.fasterxml.jackson.jakarta.rs.base.util.LRUMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-jakarta-rs-base Show documentation
Show all versions of jackson-jakarta-rs-base Show documentation
Pile of code that is shared by all Jackson-based Jakarta-RS
providers.
package com.fasterxml.jackson.jakarta.rs.base.util;
import java.util.LinkedHashMap;
import java.util.Map;
// TO BE REMOVED FROM 2.18 or later
/**
* Helper for simple bounded LRU maps used for reusing lookup values.
*
* @deprecated Since 2.16.1 use {@code LRUMap} from {@code jackson-databind}.
*/
@Deprecated // since 2.16.1
@SuppressWarnings("serial")
public class LRUMap extends LinkedHashMap
{
protected final int _maxEntries;
public LRUMap(int initialEntries, int maxEntries)
{
super(initialEntries, 0.8f, true);
_maxEntries = maxEntries;
}
@Override
protected boolean removeEldestEntry(Map.Entry eldest)
{
return size() > _maxEntries;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy