Class RICacheEntryEvent<K,​V>

  • Type Parameters:
    K - the type of keys maintained by this cache
    V - the type of cached values
    All Implemented Interfaces:
    Serializable, javax.cache.Cache.Entry<K,​V>

    public class RICacheEntryEvent<K,​V>
    extends javax.cache.event.CacheEntryEvent<K,​V>
    The reference implementation of the CacheEntryEvent.
    Since:
    1.0
    Author:
    Greg Luck
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RICacheEntryEvent​(javax.cache.Cache<K,​V> source, K key, V value, javax.cache.event.EventType eventType)
      Constructs a cache entry event from a given cache as source (without an old value)
      RICacheEntryEvent​(javax.cache.Cache<K,​V> source, K key, V value, V oldValue, javax.cache.event.EventType eventType)
      Constructs a cache entry event from a given cache as source (with an old value)
      RICacheEntryEvent​(javax.cache.Cache<K,​V> source, K key, V value, V oldValue, javax.cache.event.EventType eventType, boolean oldValueAvailable)
      Constructs a cache entry event from a given cache as source with an old value, explicitly specifying whether old value is available
    • Constructor Detail

      • RICacheEntryEvent

        public RICacheEntryEvent​(javax.cache.Cache<K,​V> source,
                                 K key,
                                 V value,
                                 javax.cache.event.EventType eventType)
        Constructs a cache entry event from a given cache as source (without an old value)
        Parameters:
        source - the cache that originated the event
        key - the key
        value - the value
      • RICacheEntryEvent

        public RICacheEntryEvent​(javax.cache.Cache<K,​V> source,
                                 K key,
                                 V value,
                                 V oldValue,
                                 javax.cache.event.EventType eventType)
        Constructs a cache entry event from a given cache as source (with an old value)
        Parameters:
        source - the cache that originated the event
        key - the key
        value - the value
        oldValue - the oldValue
      • RICacheEntryEvent

        public RICacheEntryEvent​(javax.cache.Cache<K,​V> source,
                                 K key,
                                 V value,
                                 V oldValue,
                                 javax.cache.event.EventType eventType,
                                 boolean oldValueAvailable)
        Constructs a cache entry event from a given cache as source with an old value, explicitly specifying whether old value is available
        Parameters:
        source - the cache that originated the event
        key - the key
        value - the value
        oldValue - the oldValue
        oldValueAvailable - indicates whether old value is available
    • Method Detail

      • getKey

        public K getKey()
        Returns the key of the cache entry with the event
        Returns:
        the key
      • getValue

        public V getValue()
        Returns the value of the cache entry with the event
        Specified by:
        getValue in interface javax.cache.Cache.Entry<K,​V>
        Specified by:
        getValue in class javax.cache.event.CacheEntryEvent<K,​V>
        Returns:
        the value
      • unwrap

        public <T> T unwrap​(Class<T> clazz)
      • getOldValue

        public V getOldValue()
        Specified by:
        getOldValue in class javax.cache.event.CacheEntryEvent<K,​V>
      • isOldValueAvailable

        public boolean isOldValueAvailable()
        Whether the old value is available
        Specified by:
        isOldValueAvailable in class javax.cache.event.CacheEntryEvent<K,​V>
        Returns:
        true if the old value is populated