Class DefaultKeyGenerator
- java.lang.Object
- org.springframework.cache.interceptor.DefaultKeyGenerator
- All Implemented Interfaces:
KeyGenerator
@Deprecated public class DefaultKeyGenerator extends Object implements KeyGenerator
Deprecated.as of Spring 4.0, in favor ofSimpleKeyGeneratoror customKeyGeneratorimplementations 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 anynullparameters 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
SimpleKeyGeneratoris used when no explicit key generator has been defined. This class remains for applications that do not wish to migrate to theSimpleKeyGenerator.- Since:
- 3.1
- Author:
- Costin Leau, Chris Beams, Juergen Hoeller
Field Summary
Fields Modifier and Type Field Description static intNO_PARAM_KEYDeprecated.static intNULL_PARAM_KEYDeprecated.
Constructor Summary
Constructors Constructor Description DefaultKeyGenerator()Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Objectgenerate(Object target, Method method, Object... params)Deprecated.Generate a key for the given method and its parameters.
Field Detail
NO_PARAM_KEY
public static final int NO_PARAM_KEY
Deprecated.- See Also:
- Constant Field Values
NULL_PARAM_KEY
public static final int NULL_PARAM_KEY
Deprecated.- See Also:
- Constant Field Values
Constructor Detail
DefaultKeyGenerator
public DefaultKeyGenerator()
Deprecated.
Method Detail
generate
public Object generate(Object target, Method method, Object... params)
Deprecated.Description copied from interface:KeyGeneratorGenerate a key for the given method and its parameters.- Specified by:
generatein interfaceKeyGenerator- Parameters:
target- the target instancemethod- the method being calledparams- the method parameters (with any var-args expanded)- Returns:
- a generated key