Class CacheLoader.FunctionToCacheLoader<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    CacheLoader<K,​V>

    private static final class CacheLoader.FunctionToCacheLoader<K,​V>
    extends CacheLoader<K,​V>
    implements java.io.Serializable
    • Field Detail

      • computingFunction

        private final Function<K,​V> computingFunction
    • Constructor Detail

      • FunctionToCacheLoader

        public FunctionToCacheLoader​(Function<K,​V> computingFunction)
    • Method Detail

      • load

        public V load​(K key)
        Description copied from class: CacheLoader
        Computes or retrieves the value corresponding to key.
        Specified by:
        load in class CacheLoader<K,​V>
        Parameters:
        key - the non-null key whose value should be loaded
        Returns:
        the value associated with key; must not be null