Class SimpleKeyGenerator
java.lang.Object
org.springframework.cache.interceptor.SimpleKeyGenerator
- All Implemented Interfaces:
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
ConcurrentMapCache
, however,
might not be suitable for all Cache
implementations.
- Since:
- 4.0
- Author:
- Phillip Webb, Juergen Hoeller
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SimpleKeyGenerator
public SimpleKeyGenerator()
-
-
Method Details
-
generate
Description copied from interface:KeyGenerator
Generate a key for the given method and its parameters.- Specified by:
generate
in interfaceKeyGenerator
- Parameters:
target
- the target instancemethod
- the method being calledparams
- the method parameters (with any var-args expanded)- Returns:
- a generated key
-
generateKey
Generate a key based on the specified parameters.
-