org.mockserver.collections.CircularHashMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
package org.mockserver.collections;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author jamesdbloom
*/
class CircularHashMap extends LinkedHashMap {
static final long serialVersionUID = 1530623482381786485L;
private final int maxSize;
public CircularHashMap(int maxSize) {
this.maxSize = maxSize;
}
@Override
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > maxSize;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy