Class Cached<K,​V>

  • Type Parameters:
    K - The type of the cache key.
    V - The type of the value.
    All Implemented Interfaces:
    Function<K,​V>

    public class Cached<K,​V>
    extends Object
    implements Function<K,​V>
    A simple wrapper, wrapping a Function<K,V> such that all calculations are cached in a ConcurrentHashMap<K,V>
    Author:
    Christian Fries
    • Method Detail

      • of

        public static <K,​V> Function<K,​V> of​(Function<K,​V> mappingFunction)
      • apply

        public V apply​(K key)
        Specified by:
        apply in interface Function<K,​V>