Package org.ehcache.event
Interface CacheEvent<K,V>
- Type Parameters:
K- the key type of the source cacheV- the value type of the source cache
public interface CacheEvent<K,V>
An event resulting from a mutative
Cache operation.-
Method Details
-
getType
EventType getType()Gets theEventTypeof this event.- Returns:
- the
EventType
-
getKey
K getKey()The key of the mapping affected by this event.- Returns:
- the key of the mutated mapping
-
getNewValue
V getNewValue()The mapped value immediately after the mutative event occurred.If the mutative event removes the mapping then
nullis returned.- Returns:
- the mapped value after the mutation
-
getOldValue
V getOldValue()The mapped value immediately before the mutative event occurred.If the mutative event created the mapping then
nullis returned.- Returns:
- the mapped value before the mutation
-
getSource
Deprecated.The source cache for this eventCalling back into the cache to perform operations is not supported. It is only provided as a way to identify the event source.
- Returns:
- the source cache
-