Class Caffeine.CacheWriterAdapter<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Caffeine.CacheWriterAdapter<K,V>
- All Implemented Interfaces:
CacheWriter<K,
,V> Serializable
static final class Caffeine.CacheWriterAdapter<K,V>
extends Object
implements CacheWriter<K,V>, Serializable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final RemovalListener
<? super K, ? super V> (package private) final boolean
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionCacheWriterAdapter
(RemovalListener<? super K, ? super V> delegate, boolean isAsync) -
Method Summary
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
isAsync
final boolean isAsync
-
-
Constructor Details
-
CacheWriterAdapter
CacheWriterAdapter(RemovalListener<? super K, ? super V> delegate, boolean isAsync)
-
-
Method Details
-
write
Description copied from interface:CacheWriter
Writes the value corresponding to thekey
to the external resource. The cache will communicate a write when an entry in the cache is created or modified, except when that was due to a load or computation.- Specified by:
write
in interfaceCacheWriter<K,
V> - Parameters:
key
- the non-null key whose value should be writtenvalue
- the value associated withkey
that should be written
-
delete
Description copied from interface:CacheWriter
Deletes the value corresponding to thekey
from the external resource. The cache will communicate a delete when the entry is explicitly removed or evicted.- Specified by:
delete
in interfaceCacheWriter<K,
V> - Parameters:
key
- the non-null key whose value was removedvalue
- the value associated withkey
, ornull
if collectedcause
- the reason for which the entry was removed
-