类 DefaultKeyGenerator
- java.lang.Object
- org.springframework.cache.interceptor.DefaultKeyGenerator
- 所有已实现的接口:
KeyGenerator
@Deprecated public class DefaultKeyGenerator extends Object implements KeyGenerator
已过时。as of Spring 4.0, in favor ofSimpleKeyGenerator
or customKeyGenerator
implementations based on hash codesDefault key generator. Returns 0 if no parameters are provided, the parameter itself if only one is given or a hash code computed from all given parameters' hash code values. Uses the constant value 53 for anynull
parameters given.NOTE: As this implementation returns only a hash of the parameters it is possible for key collisions to occur. Since Spring 4.0 the
SimpleKeyGenerator
is used when no explicit key generator has been defined. This class remains for applications that do not wish to migrate to theSimpleKeyGenerator
.- 从以下版本开始:
- 3.1
- 作者:
- Costin Leau, Chris Beams, Juergen Hoeller
字段概要
字段 修饰符和类型 字段 说明 static int
NO_PARAM_KEY
已过时。static int
NULL_PARAM_KEY
已过时。
构造器概要
构造器 构造器 说明 DefaultKeyGenerator()
已过时。
字段详细资料
NO_PARAM_KEY
public static final int NO_PARAM_KEY
已过时。- 另请参阅:
- 常量字段值
NULL_PARAM_KEY
public static final int NULL_PARAM_KEY
已过时。- 另请参阅:
- 常量字段值
构造器详细资料
DefaultKeyGenerator
public DefaultKeyGenerator()
已过时。
方法详细资料
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