Interface CacheFactory
- All Known Implementing Classes:
CacheFactory.NeverCacheFactory
public interface CacheFactory
Factory used for creation of generic
caches.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classCacheFactorywhich always createsno-op caches. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CacheFactorynever()Creates a cache factory which always createsno-op caches.<K,V> @NotNull Cache<K, V> Creates a new cache whose values will be storedsoftly.<K,V> @NotNull Cache<K, V> Creates a new cache whose keys will be storedweakly.<K,V> @NotNull Cache<K, V> Creates a new cache whose values will be storedweakly.
-
Method Details
-
weakKeysCache
Creates a new cache whose keys will be storedweakly.- Type Parameters:
K- type of cache keysV- type of cached values- Returns:
- weak keys cache
-
weakValuesCache
Creates a new cache whose values will be storedweakly.- Type Parameters:
K- type of cache keysV- type of cached values- Returns:
- weak values cache
-
softValuesCache
Creates a new cache whose values will be storedsoftly.- Type Parameters:
K- type of cache keysV- type of cached values- Returns:
- soft values cache
-
never
Creates a cache factory which always createsno-op caches.- Returns:
- cache factory which always supplies
no-op caches
-