Class DummyCache

java.lang.Object
org.sonar.java.caching.DummyCache
All Implemented Interfaces:
JavaReadCache, JavaWriteCache

public class DummyCache extends Object implements JavaReadCache, JavaWriteCache
  • Constructor Details

    • DummyCache

      public DummyCache()
  • Method Details

    • read

      public InputStream read(String key)
      Description copied from interface: JavaReadCache
      Returns an input stream for the data cached with the provided key. It is the responsibility of the caller to close the stream.
      Specified by:
      read in interface JavaReadCache
    • readBytes

      @CheckForNull public byte[] readBytes(String key)
      Specified by:
      readBytes in interface JavaReadCache
      Returns:
      the array of bytes stored for the given key, if any. null otherwise.
    • contains

      public boolean contains(String key)
      Description copied from interface: JavaReadCache
      Checks whether the cache contains the provided key.
      Specified by:
      contains in interface JavaReadCache
    • write

      public void write(String key, InputStream data)
      Description copied from interface: JavaWriteCache
      Save a new entry in the cache. The stream will be consumed immediately.
      Specified by:
      write in interface JavaWriteCache
    • write

      public void write(String key, byte[] data)
      Description copied from interface: JavaWriteCache
      Save a new entry in the cache.
      Specified by:
      write in interface JavaWriteCache
    • copyFromPrevious

      public void copyFromPrevious(String key)
      Description copied from interface: JavaWriteCache
      Copy a cached entry from the previous cache to the new one.
      Specified by:
      copyFromPrevious in interface JavaWriteCache