类 SimpleKeyGenerator
- java.lang.Object
- org.springframework.cache.interceptor.SimpleKeyGenerator
- 所有已实现的接口:
KeyGenerator
public class SimpleKeyGenerator extends Object implements KeyGenerator
Simple key generator. Returns the parameter itself if a single non-null value is given, otherwise returns aSimpleKey
of the parameters.Unlike
DefaultKeyGenerator
, no collisions will occur with the keys generated by this class. The returnedSimpleKey
object can be safely used with aConcurrentMapCache
, however, might not be suitable for allCache
implementations.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Juergen Hoeller
- 另请参阅:
SimpleKey
,DefaultKeyGenerator
,CachingConfigurer
构造器概要
构造器 构造器 说明 SimpleKeyGenerator()
构造器详细资料
SimpleKeyGenerator
public SimpleKeyGenerator()
方法详细资料
generate
public Object generate(Object target, Method method, Object... params)
从接口复制的说明:KeyGenerator
Generate a key for the given method and its parameters.- 指定者:
generate
在接口中KeyGenerator
- 参数:
target
- the target instancemethod
- the method being calledparams
- the method parameters (with any var-args expanded)- 返回:
- a generated key
generateKey
public static Object generateKey(Object... params)
Generate a key based on the specified parameters.