java.lang.Object
com.here.platform.data.client.v2.caching.caffeine.model.CaffeineCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class CaffeineCache<K,V> extends Object implements Cache<K,V>
  • Constructor Summary

    Constructors
    Constructor
    Description
    CaffeineCache(com.github.benmanes.caffeine.cache.Cache<K,V> underlying)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the estimated size provided by the underlying cache, -1 if not available.
    long
    Returns the estimated weight provided by the underlying cache, -1 if not available.
    long
    Returns the eviction count provided by the underlying cache, -1 if not available.
    long
    Returns the eviction weight provided by the underlying cache, -1 if not available.
    get(K key)
    Returns the value associated to a key.
    getAll(Iterable<? extends K> keys)
    Returns the values associated to the keys.
    void
    put(K key, V value)
    Associates a value with the provided key.
    com.github.benmanes.caffeine.cache.Cache<K,V>
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaffeineCache

      public CaffeineCache(com.github.benmanes.caffeine.cache.Cache<K,V> underlying)
  • Method Details

    • estimatedSize

      public long estimatedSize()
      Description copied from interface: Cache
      Returns the estimated size provided by the underlying cache, -1 if not available.
      Specified by:
      estimatedSize in interface Cache<K,V>
    • estimatedWeight

      public long estimatedWeight()
      Description copied from interface: Cache
      Returns the estimated weight provided by the underlying cache, -1 if not available.
      Specified by:
      estimatedWeight in interface Cache<K,V>
    • evictionCount

      public long evictionCount()
      Description copied from interface: Cache
      Returns the eviction count provided by the underlying cache, -1 if not available.
      Specified by:
      evictionCount in interface Cache<K,V>
    • evictionWeight

      public long evictionWeight()
      Description copied from interface: Cache
      Returns the eviction weight provided by the underlying cache, -1 if not available.
      Specified by:
      evictionWeight in interface Cache<K,V>
    • get

      public V get(K key)
      Description copied from interface: Cache
      Returns the value associated to a key.

      It returns null if the key is not present in the cache.

      Specified by:
      get in interface Cache<K,V>
    • getAll

      public Map<K,V> getAll(Iterable<? extends K> keys)
      Description copied from interface: Cache
      Returns the values associated to the keys.

      It returns only the entries that are already present in the cache.

      Specified by:
      getAll in interface Cache<K,V>
    • put

      public void put(K key, V value)
      Description copied from interface: Cache
      Associates a value with the provided key.

      If the key is already present, it updates the value.

      Specified by:
      put in interface Cache<K,V>
    • underlying

      public com.github.benmanes.caffeine.cache.Cache<K,V> underlying()