Package org.sonar.java.caching
Class DummyCache
java.lang.Object
org.sonar.java.caching.DummyCache
- All Implemented Interfaces:
JavaReadCache
,JavaWriteCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the cache contains the providedkey
.void
copyFromPrevious
(String key) Copy a cached entry from the previous cache to the new one.Returns an input stream for the data cached with the providedkey
.byte[]
void
Save a new entry in the cache.void
write
(String key, InputStream data) Save a new entry in the cache.
-
Constructor Details
-
DummyCache
public DummyCache()
-
-
Method Details
-
read
Description copied from interface:JavaReadCache
Returns an input stream for the data cached with the providedkey
. It is the responsibility of the caller to close the stream.- Specified by:
read
in interfaceJavaReadCache
-
readBytes
- Specified by:
readBytes
in interfaceJavaReadCache
- Returns:
- the array of bytes stored for the given key, if any.
null
otherwise.
-
contains
Description copied from interface:JavaReadCache
Checks whether the cache contains the providedkey
.- Specified by:
contains
in interfaceJavaReadCache
-
write
Description copied from interface:JavaWriteCache
Save a new entry in the cache. The stream will be consumed immediately.- Specified by:
write
in interfaceJavaWriteCache
-
write
Description copied from interface:JavaWriteCache
Save a new entry in the cache.- Specified by:
write
in interfaceJavaWriteCache
-
copyFromPrevious
Description copied from interface:JavaWriteCache
Copy a cached entry from the previous cache to the new one.- Specified by:
copyFromPrevious
in interfaceJavaWriteCache
-