Class NoCache<K,​V>

  • Type Parameters:
    K - The key type.
    V - The value type.
    All Implemented Interfaces:
    Cache<K,​V>

    public class NoCache<K,​V>
    extends Object
    implements Cache<K,​V>
    A cache implementation that does not store any information.
    • Constructor Detail

      • NoCache

        public NoCache()
    • Method Detail

      • create

        public static <expectedK,​expectedV> NoCache<expectedK,​expectedV> create()
        Create a new instance.
        Type Parameters:
        expectedK - The expected type for the key.
        expectedV - The expected type for the value.
        Returns:
        A newly created instance of NoCache.
      • put

        public void put​(K key,
                        V value)
        Specified by:
        put in interface Cache<K,​V>
      • remove

        public void remove​(K key)
        Specified by:
        remove in interface Cache<K,​V>
      • removeAll

        public void removeAll()
        Specified by:
        removeAll in interface Cache<K,​V>
      • contains

        public boolean contains​(K key)
        Specified by:
        contains in interface Cache<K,​V>
      • size

        public long size()
        Specified by:
        size in interface Cache<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Cache<K,​V>