Class ValueCache<K,​V>

  • Type Parameters:
    K - key object type
    V - stored object type

    public class ValueCache<K,​V>
    extends java.lang.Object
    Simple store for values depending on 'key' object.
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueCache()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V get​(K requestKey, java.util.function.Function<K,​V> loadFunc)
      Return a stored object if key not changed, load a new object overwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValueCache

        public ValueCache()
    • Method Detail

      • get

        public V get​(K requestKey,
                     java.util.function.Function<K,​V> loadFunc)
        Return a stored object if key not changed, load a new object overwise.