Package org.sonar.python.caching
Class DummyCache
- java.lang.Object
-
- org.sonar.python.caching.DummyCache
-
- All Implemented Interfaces:
PythonReadCache,PythonWriteCache
public class DummyCache extends Object implements PythonReadCache, PythonWriteCache
-
-
Constructor Summary
Constructors Constructor Description DummyCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String key)Checks whether the cache contains the providedkey.voidcopyFromPrevious(String key)Copy a cached entry from the previous cache to the new one.InputStreamread(String key)Returns an input stream for the data cached with the providedkey.byte[]readBytes(String key)voidwrite(String key, byte[] data)Save a new entry in the cache.
-
-
-
Method Detail
-
read
public InputStream read(String key)
Description copied from interface:PythonReadCacheReturns an input stream for the data cached with the providedkey. It is the responsibility of the caller to close the stream.- Specified by:
readin interfacePythonReadCache
-
readBytes
@CheckForNull public byte[] readBytes(String key)
- Specified by:
readBytesin interfacePythonReadCache- Returns:
- the array of bytes stored for the given key, if any.
nullotherwise.
-
contains
public boolean contains(String key)
Description copied from interface:PythonReadCacheChecks whether the cache contains the providedkey.- Specified by:
containsin interfacePythonReadCache
-
write
public void write(String key, byte[] data)
Description copied from interface:PythonWriteCacheSave a new entry in the cache.- Specified by:
writein interfacePythonWriteCache
-
copyFromPrevious
public void copyFromPrevious(String key)
Description copied from interface:PythonWriteCacheCopy a cached entry from the previous cache to the new one.- Specified by:
copyFromPreviousin interfacePythonWriteCache
-
-