Class Cache<K,​V>

  • Type Parameters:
    K - The type of the key
    V - The type of the value
    Direct Known Subclasses:
    Repository

    public abstract class Cache<K,​V>
    extends Object
    Cache is the abstract class for caches.
    • Field Detail

      • cache

        private final Map<K,​V> cache
        The cache.
    • Constructor Detail

      • Cache

        public Cache()
    • Method Detail

      • isCached

        public boolean isCached​(K key)
        Returns true if the cache contains the key.
        Parameters:
        key - The key
        Returns:
        True if the cache contains the key
      • getCache

        public V getCache​(K key)
        Returns the value associated with the key.
        Parameters:
        key - The key
        Returns:
        The value
      • putCache

        public void putCache​(K key,
                             V value)
        Puts the key-value pair in the cache.
        Parameters:
        key - The key
        value - The value