Class DecoratedCache<K,V>

All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>, AdvancedCache<K,V>, Cache<K,V>, InternalCache<K,V>, AsyncCache<K,V>, BasicCache<K,V>, BatchingCache, Lifecycle, TransactionalCache, FilteringListenable<K,V>, Listenable

public class DecoratedCache<K,V> extends AbstractDelegatingAdvancedCache<K,V>
A decorator to a cache, which can be built with a specific set of Flags. This set of Flags will be applied to all cache invocations made via this decorator.

In addition to cleaner and more readable code, this approach offers a performance benefit to using AdvancedCache.withFlags(Flag...) API, thanks to internal optimizations that can be made when the Flag set is unchanging.

Note that DecoratedCache must be the closest Delegate to the actual Cache implementation. All others must delegate to this DecoratedCache.

Since:
5.1
Author:
Manik Surtani, Sanne Grinovero, Tristan Tarrant
See Also: