Package com.globalmentor.cache
Class CacheFetchEvent<Q,V>
- java.lang.Object
-
- java.util.EventObject
-
- com.globalmentor.cache.CacheFetchEvent<Q,V>
-
- Type Parameters:
Q
- The type of query used to request data from the cache.V
- The type of value stored in the cache.
- All Implemented Interfaces:
java.io.Serializable
public class CacheFetchEvent<Q,V> extends java.util.EventObject
An event that is fired when a value is fetched in the cache.- Author:
- Garret Wilson
- See Also:
Cache
,CacheFetchListener
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Q
getQuery()
Cache<Q,V>
getSource()
The cache which fetched the value.V
getValue()
-
-
-
Constructor Detail
-
CacheFetchEvent
public CacheFetchEvent(Cache<Q,V> source, Q query, V value)
Source and property name constructor with old and new values. The target will be set to be the same as the given source.- Parameters:
source
- The bean that fired the event.query
- The query used to request data from the cache.value
- The fetched value.- Throws:
java.lang.NullPointerException
- if the given source, query, and/or value isnull
.
-
-
Method Detail
-
getSource
public Cache<Q,V> getSource()
The cache which fetched the value.- Overrides:
getSource
in classjava.util.EventObject
- Returns:
- The object on which the Event initially occurred.
-
getQuery
public Q getQuery()
- Returns:
- The query used to request data from the cache.
-
getValue
public V getValue()
- Returns:
- The fetched value.
-
-