Interface CacheLoader<K,​V>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      V load​(K key)
      Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
      default Map<K,​V> loadAll​(Collection<? extends K> colKeys)
      Return the values associated with each the specified keys in the passed collection.
    • Method Detail

      • load

        V load​(K key)
        Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
        Parameters:
        key - key whose associated value is to be returned
        Returns:
        the value associated with the specified key, or null if no value is available for that key
      • loadAll

        default Map<K,​V> loadAll​(Collection<? extends K> colKeys)
        Return the values associated with each the specified keys in the passed collection. If a key does not have an associated value in the underlying store, then the return map will not have an entry for that key.

        The default implementation of this method calls load(K) for each key in the supplied Collection. Implementations that can optimize multi-key operations should override this default implementation.

        Parameters:
        colKeys - a collection of keys to load
        Returns:
        a Map of keys to associated values for the specified keys