Class RICacheEntryEvent<K,V>

java.lang.Object
java.util.EventObject
javax.cache.event.CacheEntryEvent<K,V>
org.infinispan.jcache.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:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • 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
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the key of the cache entry with the event
    Returns the value of the cache entry with the event
    boolean
    Whether the old value is available
     
    <T> T
    unwrap(Class<T> clazz)

    Methods inherited from class javax.cache.event.CacheEntryEvent

    getEventType, getSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • 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 Details

    • 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
    • toString

      public String toString()
      Overrides:
      toString in class EventObject