Package io.micronaut.cache.interceptor
Class DefaultCacheKeyGenerator
java.lang.Object
io.micronaut.cache.interceptor.DefaultCacheKeyGenerator
- All Implemented Interfaces:
CacheKeyGenerator
- Direct Known Subclasses:
KotlinSuspendFunCacheKeyGenerator
A default implementation of the CacheKeyGenerator
interface that uses the parameters of the method only.
This implementation is appropriate for most common cases but note that collisions can occur for classes that use the same cache and have overlapping signatures as the default implementation does not use the method itself when generating the key
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateKey
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Object... params) Generate a key for the given annotated element and parameters.
-
Constructor Details
-
DefaultCacheKeyGenerator
public DefaultCacheKeyGenerator()
-
-
Method Details
-
generateKey
public Object generateKey(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Object... params) Description copied from interface:CacheKeyGenerator
Generate a key for the given annotated element and parameters.- Specified by:
generateKey
in interfaceCacheKeyGenerator
- Parameters:
annotationMetadata
- The annotated metadataparams
- The parameters- Returns:
- The generated key. Never null.
-