Class ConditionalCacheInvalidator<K extends String,​V>

  • Type Parameters:
    K - the type for the keys
    V - 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 Detail

      • patterns

        protected List<String> patterns
        The list of patterns to match the key
    • Method Detail

      • invalidate

        public void invalidate​(com.google.common.cache.Cache<K,​V> cache,
                               K key)
        Description copied from interface: CacheInvalidator
        Performs the cache invalidation based on the given key
        Specified by:
        invalidate in interface CacheInvalidator<K extends String,​V>
        Parameters:
        cache - the cache instance
        key - the key to invalidate