spring-framework / org.springframework.cache.interceptor / SimpleKeyGenerator

SimpleKeyGenerator

open class SimpleKeyGenerator : KeyGenerator

Simple key generator. Returns the parameter itself if a single non-null value is given, otherwise returns a SimpleKey of the parameters.

No collisions will occur with the keys generated by this class. The returned SimpleKey object can be safely used with a org.springframework.cache.concurrent.ConcurrentMapCache, however, might not be suitable for all org.springframework.cache.Cache implementations.

Author
Phillip Webb

Author
Juergen Hoeller

Since
4.0

See Also
SimpleKeyorg.springframework.cache.annotation.CachingConfigurer

Constructors

<init>

SimpleKeyGenerator()

Simple key generator. Returns the parameter itself if a single non-null value is given, otherwise returns a SimpleKey of the parameters.

No collisions will occur with the keys generated by this class. The returned SimpleKey object can be safely used with a org.springframework.cache.concurrent.ConcurrentMapCache, however, might not be suitable for all org.springframework.cache.Cache implementations.

Functions

generate

open fun generate(target: Any, method: Method, vararg params: Any): Any

generateKey

open static fun generateKey(vararg params: Any): Any

Generate a key based on the specified parameters.