Class Caffeine.CacheWriterAdapter<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Caffeine.CacheWriterAdapter<K,V>
-
- All Implemented Interfaces:
CacheWriter<K,V>,java.io.Serializable
static final class Caffeine.CacheWriterAdapter<K,V> extends java.lang.Object implements CacheWriter<K,V>, java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) RemovalListener<? super K,? super V>delegate(package private) booleanisAsyncprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description CacheWriterAdapter(RemovalListener<? super K,? super V> delegate, boolean isAsync)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(K key, @Nullable V value, RemovalCause cause)Deletes the value corresponding to thekeyfrom the external resource.voidwrite(K key, V value)Writes the value corresponding to thekeyto the external resource.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
delegate
final RemovalListener<? super K,? super V> delegate
-
isAsync
final boolean isAsync
-
-
Constructor Detail
-
CacheWriterAdapter
CacheWriterAdapter(RemovalListener<? super K,? super V> delegate, boolean isAsync)
-
-
Method Detail
-
write
public void write(K key, V value)
Description copied from interface:CacheWriterWrites the value corresponding to thekeyto 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:
writein interfaceCacheWriter<K,V>- Parameters:
key- the non-null key whose value should be writtenvalue- the value associated withkeythat should be written
-
delete
public void delete(K key, @Nullable V value, RemovalCause cause)
Description copied from interface:CacheWriterDeletes the value corresponding to thekeyfrom the external resource. The cache will communicate a delete when the entry is explicitly removed or evicted.- Specified by:
deletein interfaceCacheWriter<K,V>- Parameters:
key- the non-null key whose value was removedvalue- the value associated withkey, ornullif collectedcause- the reason for which the entry was removed
-
-