Interface CacheEvent<K,​V>

  • Type Parameters:
    K - the key type of the source cache
    V - the value type of the source cache

    public interface CacheEvent<K,​V>
    An event resulting from a mutative Cache operation.
    • Method Detail

      • 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 null is 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 null is returned.

        Returns:
        the mapped value before the mutation
      • getSource

        @Deprecated
        Cache<K,​V> getSource()
        Deprecated.
        The source cache for this event

        Calling 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