Class LruCache.Builder<K,V>

java.lang.Object
io.helidon.common.configurable.LruCache.Builder<K,V>
Type Parameters:
K - type of keys
V - type of values
All Implemented Interfaces:
Builder<LruCache.Builder<K,V>,LruCache<K,V>>, Supplier<LruCache<K,V>>
Enclosing class:
LruCache<K,V>

public static class LruCache.Builder<K,V> extends Object implements Builder<LruCache.Builder<K,V>,LruCache<K,V>>
Fluent API builder for LruCache.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public LruCache<K,V> build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<K,V>
      Returns:
      instance of the built type
    • config

      public LruCache.Builder<K,V> config(Config config)
      Load configuration of this cache from configuration.
      Parameters:
      config - configuration
      Returns:
      updated builder instance
    • capacity

      public LruCache.Builder<K,V> capacity(int capacity)
      Configure capacity of the cache.
      Parameters:
      capacity - maximal number of records in the cache before the oldest one is removed
      Returns:
      updated builder instance