Class ConditionalCacheInvalidator<K extends String,V>
java.lang.Object
org.craftercms.studio.impl.v2.utils.cache.ConditionalCacheInvalidator<K,V>
- Type Parameters:
K
- the type for the keysV
- the type for the values
- All Implemented Interfaces:
CacheInvalidator<K,
V>
public class ConditionalCacheInvalidator<K extends String,V>
extends Object
implements CacheInvalidator<K,V>
Implementation of
CacheInvalidator
that only performs the invalidation if the key matches a pattern- Since:
- 4.0
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CacheInvalidator
<K, V> The list of patterns to match the key -
Constructor Summary
ConstructorsConstructorDescriptionConditionalCacheInvalidator
(List<String> patterns, CacheInvalidator<K, V> actualCacheInvalidator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
invalidate
(com.google.common.cache.Cache<K, V> cache, K key) Performs the cache invalidation based on the given key
-
Field Details
-
patterns
The list of patterns to match the key -
actualCacheInvalidator
-
-
Constructor Details
-
ConditionalCacheInvalidator
@ConstructorProperties({"patterns","actualCacheInvalidator"}) public ConditionalCacheInvalidator(List<String> patterns, CacheInvalidator<K, V> actualCacheInvalidator)
-
-
Method Details
-
invalidate
Description copied from interface:CacheInvalidator
Performs the cache invalidation based on the given key- Specified by:
invalidate
in interfaceCacheInvalidator<K extends String,
V> - Parameters:
cache
- the cache instancekey
- the key to invalidate
-