Class 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
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheFetchEvent​(Cache<Q,​V> source, Q query, V value)
      Source and property name constructor with old and new values.
    • 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()  
      • Methods inherited from class java.util.EventObject

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 is null.
    • Method Detail

      • getSource

        public Cache<Q,​V> getSource()
        The cache which fetched the value.
        Overrides:
        getSource in class java.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.