This method creates a cache filter that can be used to operate on a cache instance and its keys.
The filter can be used to clear, get, or remove keys from the cache.
All filters must be adhere to the ,{@link ICacheKeyFilter}, interface.
Example:
,
,
cache().clear( cacheFilter( "foo*" ) );
cache().clear( cacheFilter( ".foo.", true ) );
You can also create your own custom cache filter by using a closure/lambda that
accepts a ,{@code
Key
}, and returns a boolean.
Example:
,,cache().clear( key -> key.getName().startsWith( "foo" ) );cache().clear( key -> key.getName().matches( ".foo." ) );,
Method Signature
CacheFilter(filter=[string], useRegex=[boolean])
Arguments
Examples
Related