public interface AffinityKeyMapper extends Serializable
affinityKey(Object)method, and the returned value of this method will be given to
AffinityFunctionimplementation to find out key-to-node affinity.
The default implementation, which will be used if no explicit affinity mapper is specified
in cache configuration, will first look for any field or method annotated with
@AffinityKeyMapped annotation. If such field or method
is not found, then the cache key itself will be returned from
method (this means that all objects with the same cache key will always be routed to the same node).
If such field or method is found, then the value of this field or method will be returned from
affinityKey(Object) method. This allows to specify alternate affinity key, other
than the cache key itself, whenever needed.
A custom (other than default) affinity mapper can be provided
CacheConfiguration.getAffinityMapper() configuration property.
key- Key to map.