public interface KeyExtractor<T>
extends java.io.Serializable
Extract keys from objects. An implementation of this interface extracts keys from objects such that two objects have the same key if and only if they should be considered equivalent objects in some context. This is used for objects that contain information about some key, such as ratings for an item.
Key extractors must be serializable so that the object maps that use them can be serialized.
Modifier and Type | Method and Description |
---|---|
long |
getKey(T obj)
Get the key for an object.
|
long getKey(T obj)
Get the key for an object.
obj
- The object.