Package io.micronaut.cache.interceptor
Class DefaultCacheKeyGenerator
- java.lang.Object
-
- io.micronaut.cache.interceptor.DefaultCacheKeyGenerator
-
- All Implemented Interfaces:
CacheKeyGenerator
- Direct Known Subclasses:
KotlinSuspendFunCacheKeyGenerator
@Introspected public class DefaultCacheKeyGenerator extends java.lang.Object implements CacheKeyGenerator
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
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheKeyGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
generateKey(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.Object... params)
Generate a key for the given annotated element and parameters.
-
-
-
Method Detail
-
generateKey
public java.lang.Object generateKey(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.lang.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.
-
-