Interface LruCacheConfig<K,V>

Type Parameters:
K - type of keys
V - type of values
All Superinterfaces:
Prototype.Api, Prototype.Factory<LruCache<K,V>>
All Known Implementing Classes:
LruCacheConfig.BuilderBase.LruCacheConfigImpl

public interface LruCacheConfig<K,V> extends Prototype.Api
Configuration of a LRU Cache.
See Also:
  • Method Details

    • builder

      static <K, V> LruCacheConfig.Builder<K,V> builder()
      Create a new fluent API builder to customize configuration.
      Type Parameters:
      K - type of keys
      V - type of values
      Returns:
      a new builder
    • builder

      static <K, V> LruCacheConfig.Builder<K,V> builder(LruCacheConfig<K,V> instance)
      Create a new fluent API builder from an existing instance.
      Type Parameters:
      K - type of keys
      V - type of values
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static <K, V> LruCacheConfig<K,V> create(Config config)
      Create a new instance from configuration.
      Type Parameters:
      K - type of keys
      V - type of values
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static <K, V> LruCacheConfig<K,V> create()
      Create a new instance with default values.
      Type Parameters:
      K - type of keys
      V - type of values
      Returns:
      a new instance
    • capacity

      int capacity()
      Configure capacity of the cache. Defaults to 10000<K,V>.
      Returns:
      maximal number of records in the cache before the oldest one is removed