类 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 aSimpleKeyof the parameters.No collisions will occur with the keys generated by this class. The returned
SimpleKeyobject can be safely used with aConcurrentMapCache, however, might not be suitable for allCacheimplementations.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Juergen Hoeller
- 另请参阅:
SimpleKey,CachingConfigurer
构造器概要
构造器 构造器 说明 SimpleKeyGenerator()
构造器详细资料
SimpleKeyGenerator
public SimpleKeyGenerator()
方法详细资料
generate
public Object generate(Object target, Method method, Object... params)
从接口复制的说明:KeyGeneratorGenerate 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.