All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.httpproxy.impl.CacheImpl Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR3
Show newest version
package io.vertx.httpproxy.impl;

import io.vertx.httpproxy.cache.CacheOptions;
import io.vertx.httpproxy.spi.cache.Cache;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Simplistic implementation.
 */
public class CacheImpl extends LinkedHashMap implements Cache {

  private final int maxSize;

  public CacheImpl(CacheOptions options) {
    this.maxSize = options.getMaxSize();
  }

  protected boolean removeEldestEntry(Map.Entry eldest) {
    return size() > maxSize;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy